As discussed in the last article, competition must exist in a free market but it is imperfect. Therefore, it is possible for one firm to gain an advantage over another firm, be it though innovation, patents, or some other form of having something the competition does not.
Because of the imperfect competition, some firms will gain market share and will eventually either be able to buy their competition or get rid of them through means such as advertising, price wars, etc. So in a further developed market, it is likely that there will only be a few firms.
Since there are only a few firms, we can call into play game theory. It is more profitable for all firms in a market to work together, effectively making a monopoly. This is called a cartel and is illegal in most countries (in a truly free market, this would not be the case, but again here is the paradox of the free market as the monopoly would control the market, making it no longer free). The problem with this approach is it is more profitable for a firm to then deviate from the cooperative state, providing it with more profits for a short period of time. Unfortunately then the other firm(s) will catch on and adjust their behaviour accordingly, thus returning the system to the competitive state it was originally in. So to prevent this and still make more profits, firms are capable of taking over other firms. They will acquire both the profits of the other firm, and they will gain more control over the market. Eventually this will lead to very few firms present in the marketplace.
Why would a firm want to be bought? One thing that is forgotten in economics (or at least the economics that I saw in my undergraduate degree) is that firms are not atomic, they are composed of individuals which may have different interests than that of the company. If the owners of the company see opportunity to make a profit for themselves by selling the company, they may do this. So there is incentive for both the buying company and the owners of the company being sold to complete the transaction, depending on the amount of money offered.