Wikipedia contains a detailed discussion of Orwell's Animal Farm. The following is an authoritative quote from that article:
The Battle of the Cowshed represents the allied invasion of the Soviet Russia in 1918, and the defeat of the White Russians in the Russian Civil War.
Following Germany's defeat in World War I, the victorious allies made an attempt to defeat the Bolsheviks who had taken over the Russian government, but they were repulsed. This is represented allegorically by Orwell as the "Battle of the Cowshed" in which the humans try to retake the farm from the animals.
The article on "Animal Farm" in Wikipedia offers a thorough explanation of every aspect of Orwell's book plus much additional background information.