The Marshall Plan had two interrelated goals. The Plan was intended to improve the economic situations of the countries of Western Europe and, at the same time, to discourage them from embracing communism.
After WWII, the countries of Europe were badly damaged. The US was worried that their damaged economies, and the poverty caused by that damage, would cause those countries' citizens to be interested in becoming communist. The US was afraid that this would lead to the Soviet Union dominating all of continental Europe.
Because of this fear (and because of a sincere desire to help), the US gave huge amounts of aid to the European countries. This aid was meant to help reduce poverty and, thereby, the incentive that the Europeans would have to turn to communism.