The Battle of the Cowshed occurs early on in the life of Animal Farm, which the animals have seized from Mr. Jones. The animals, Snowball especially, prepare for a backlash.
At first, it doesn't come. The other farmers are sure that the revolution will collapse on its own in a few weeks, because they can't imagine the animals successfully running a farm. However, Animal Farm stays intact, so the other farms start to spread propaganda about the evils occurring under the animals' regime. When the animals are effectively able to propagandize in return, for example, spreading the lyrics of the "Beasts of England" song, Farmer Jones and the other farmers decide on military action.
It comes, and it mirrors the backlash and Russian Civil War after the 1917 Bolshevik revolution, which was supported by money that came from outside of Russia. In this conflict, "White" Russians, loyal to the czar, fought to take the country back from the "Reds," or communists, just as Farmer Jones and his men fight to take back Animal Farm. In the case of Russia, the Whites lost, in large part because of Trotsky's military and organizing abilities. In the case of Animal Farm, Farmer Jones is defeated, largely because Snowball, the Trotsky figure, has taken the time to study the battle strategies of Caesar.