You're buying from sellers, sellers are more or less willing to sell
Always remember when you buy a share if means someone was found willing to sell it to you at an agreed price. The quoted price represents the lowest price at which a random buyer could buy one extra share. That price corresponds to the owner that is the most willing to sell.
The more shares you buy, the further you get past those willing to sell, so the more you get to people that aren't so willing to sell, which means higher price, possibly much higher price.
The notion of "Market Depth" conveys this: a shallow market depth means that after buying relatively few shares, you get to shares that you simply can't buy.
Market depth is the market's ability to sustain relatively large market orders without impacting the price of the security
Say the company has 99,999 shares issues and a current trading price of $1; you might be able to buy the first 49,999 for 1$ each*, but the current shareholder(s) know that selling you that last share gives you control of the company. If they don't want that, then that last share may become very expensive indeed!
*In reality if you start to buy large volumes of anything you'll move the price, but let's keep the example simple.
Let's also think about how much the price might move even without the risk of you owning more than half:
Start price = S0 = 1$
Increase = r = 0.01% per share bought (that's not a lot right?)
Shares to buy = N = 50,000
Final share price = S0 * r^N = 1 * (1.0001)^50000 = 150 $
Total spent = S_0 * (1-r^N)/(1-r) = 1 * (1-1.0001^50000)/(1-1.0001) = 1.47 $m
Set the rate a bit higher:
Increase = 0.02% per share
Total = 110$m !!
That doesn't look so cheap any more!