Capitalist markets operate with a degree of freedom. As @whitenoise said, the government plays an active role in making sure that things which could potentially be harmful to the economy don’t happen. As an example, the merging of 2 large companies could create a monopoly on certain product/industry which would mean that they would be free to hold the market to ransom, charge what they want, push small businesses under, etc. which would be bad for everybody except those who own the monopoly.
Strictly speaking communism would be a better model, if only it worked in practice. Communism should promote equality, common ownership and a classless society, but in reality leads to corruption, and the population as a whole becoming deprived of freedom, or starved, or worse.
There is also the problem that even if communism were properly implemented, what incentive is there for people to rise above and put the effort into inventing novel, useful ideas, or going through the hardship of starting a business. If you put more effort in than anybody else, you’d get no special reward. Your efforts go to help the general populace, but this is small motivation when there’s phenominal effort involved in something like developing life-saving pharmaceuticals or medical techniques, or designing a jet engine, or something of the like. Why bother when you get just as much food, shelter etc. as somebody who works as a street sweeper?
It would be nice if everybody worked to further their nation, or humanity as a whole just for the sake of making life better, but ultimately we are selfish creatures. The fact that you’re reading this now means that your ancestors were selfish enough, in some way or another, to ensure that your genetic line was continued. This selfishness is to some extent what drives people to start business, and invest time in inventing and devloping things which then go on to make life better for everybody, since if you make a product everybody wants or needs, there’s a direct reward.
It would be nice, I suppose, if everybody could “win”, but in reality life isn’t like that, and why should it be? Why should somebody who is jobless through lazyness live with the same means as somebody who works 70 hours a week running their own business and keeping 20 other people employed? The answer is that in truth, they shouldn’t.
Let’s go back to my example of pharmaceutical companies. They charge a lot of money for certain drugs, which makes the owners of the companies very rich, but it also means that they can then put lots of money into research of new drugs, which they’re driven to do because new, better drugs means more profit in the future. This benefits everybody because obviously better drugs means better health for everybody (broadly speaking).
Capitalism may not be perfect, but I’ve yet to hear of any better ideas, and there’s certainly a reason why capitalist countries are the leading superpowers in the world, and why generally the standard of living in capitalist countries is better than countries with different economic models.