Especially considered in its historical context, Animal Farm is a pretty transparent allegory for the Soviet Union under Josef Stalin. Many members of the left in both the United States and Great Britain had been fascinated by, even sympathetic to, the Soviet Union during the 1930s, but the steady trickle of news about Stalin's abuses as well as the infamous Nazi-Soviet Non-Aggression Pact of 1939 left many intellectuals feeling severly disillusioned. Orwell was one of these intellectuals, having even participated in the Spanish Civil War alongside Spanish communists.
Orwell alludes to several incidents in the history of the Soviet Union and Stalin in Animal Farm. The animal revolution is an obvious nod to the Bolshevik Revolution. The exile and death sentence passed on Snowball are reminiscent of Stalin's proscription of Leon Trotsky, the deaths of the animals deemed by Napoleon to be in league with Snowball are the farm's version of Stalin's purges, and Napoleon's deal with Frederick could be construed as an evocation of the non-aggression pact itself. Overall, Orwell is aiming to show how sometimes the best intentions can go awry, and that a desire for power can often corrupt our ideals.