How did Snowball's participation in the battle of the cowshed from the actual events to the story told by the end of the novel?
Snowball's real participation in the Battle of Cowshed was brave and correct. However in Squealer's retelling of the story - Snowball's role goes from bad to worse.
Squealer begins by telling the animals that his bravery was exaggerated. Snowball had proposed the idea of the windmill and Napoleon opposed it. After realizing that if the animals had a diversion, in other words the windmill, he could gain even more power while everyone was focused on building the windmill. Squealer turns this around to tell the animals that because Snowball was so dangerous, Napoleon had to pretend to oppose the idea in order to protect them. He tells the animals that Snowball is dangerous to arouse in them suspicion and doubt. At the end of Squealer's tale of the Battle of Cowshed, Snowball is discredited and in the end the animals are made to believe that Snowball had stolen Napoleon's idea.