How is capitalism different from communism and socialism in the way it achieves key economics goals?
The main distinctions among economic systems have to do with who owns the means of production. In a capitalist system, the means of production are owned by private individuals, and workers have no real rights or ownership over the things they produce or the profits that accrue from them. Under a communist system, the means of production are owned collectively by the people engaged in labor. Under a socialist system, the means of production are owned collectively by the state government. Marx viewed socialism as a stepping stone between capitalism and communism.
Thus under a communist system, workers in a factory would have shared ownership and control of the factory, and share in its profits, whereas under capitalism, ownership of a factory is not vested in the people who work there.
No actual countries are realistically either a textbook example of capitalism or communism. Instead, all balance some forms of private and some forms of collective ownership, and also some forms of state control of industry and some forms of free market.
Capitalism depends on the idea of perfectly free markets, but no such things exist. Monopolies or oligopolies can engage in price fixing and uneven playing fields limit competition. Communism and socialism are often implemented with strong centralization, often leading to kleptocratic oligarchies.