Animal Farm is an allegory for the Russian Revolution. Mr. Jones and the humans represent the capitalists of the West. The pigs represent the leaders of the Russian Revolution and the animals are replacing the human capitalist system with their own communist system. The animal revolution is supposed to parallel the Russian Revolution (which utilized communism) in a creative, allegorical way.
Old Major represents either Karl Marx (arguably the founder of communism) or Vladimir Lenin, the man who really got the Russian Revolution moving in pursuit of a Marxist-informed communist state. Napoleon represents Joseph Stalin, the Russian leader who followed Lenin and continued the Russian push into communism. This would become a corrupt version of Karl Marx's original ideas about communism and the progress of history. Snowball represents Leon Trotsky, a Soviet politician and theorist who initially worked with Stalin but eventually differed with Stalin in political ideas. Trotsky is expelled from Russia because of this conflict and Stalin remained in power. Likewise, Snowball is expelled from the farm, leaving Napoleon in power. Napoleon accumulates more power, makes the conditions of the animals worse, and really abandons the goals of communism which is to have a classless society and to give the power of owning the means of production and labor to the animals. But the living conditions of the animals grow steadily worse and they lose control of the goods they produce. Stalin leaves a similar path of corruption.
The allegory suggests that capitalism can be a corrupt system (as it is under the leadership of Mr. Jones). The allegory also suggests that communism is easily corrupted as well (as it is under Napoleon and his historical double, Stalin). So, the novel is not simply an indictment of communism. It more broadly shows how any system can be manipulated and destroyed. The final scene illustrates this idea that there is no difference between the capitalists and the communists (the humans and the pigs, respectively). The animal/communist revolution fails because they abandon its ideals.