Does an acquiring company have to buy all the stocks of a target company to acquire/merge with it? If so, why? I thought stocks give voting rights and dividends, but not direct control of company management. If not, why do they usually do it?
Acquiring a company involves acquiring all of its shares and giving the previous shareholders money, your stock, or other valuable things, like options.
You don't have to acquire all the shares on the open market, though. You would never be able to persuade every single shareholder to sell their shares. You just have to get enough that the board of directors (or a majority of shareholders at a shareholder meeting) votes to merge the target company in, converting all existing shares into the cash or shares that you are offering.
If the management is willing, you don't have to buy any on the open market. They just vote to accept your offer to merge their company in and all shareholders receive whatever it is you offered. If the management is not in favor, you have to buy enough shares that you plus the other investors who are willing have enough influence to make it happen. This can mean replacing board members or casting direct votes.
Stocks/shares are equity (a share is 'a part of' something) and are thus essential to ownership of a company. Owning shares means that you own part nof a company. The ownership, as a side effect, gives voting rights on the C-suite and dividends.
Acquiring a company requires you to buy all of the shares of that company (so that you own it).