When a company goes public it is divided into shares of stock. Each makes up a small percentage of the company.
For instance if a company has 10,000,000 shares of stocks and you own 10 of them then you own 10 shares of the company. You can also look at it like you own 10/10,000,000 of the company or .0001% of the company.
If you are able to buy 5,000,001 shares of the company you would be the majority shareholder and have complete control over the company. This is what allows companies to take over other companies; they simply become the majority shareholder by buying more stock in that company then the previous owner.