Animal Farm relates the unfortunate events that take place on the previously named Manor farm, after the animals take control and chase Mr. Jones off the farm. The animals can now uphold their principles and they can work together promoting their cause of Animalism. The Seven Commandments are created to assist them and to ensure that "all animals are equal." It is apparent very soon that even being equal requires agreement and discussion and the pigs begin to establish themselves as superior. Having chased Snowball off the farm, Napoleon is able to begin his domination of the animals unhindered and he has Squealer to confuse and reassure the animals which causes great confusion.
The animals are told that Snowball is a traitor and that his bravery was not enough because "Loyalty and obedience are more important" (ch V). Conditions deteriorate and the hens are warned that they may have to give up eggs each week in order to purchase essential items for the windmill and certainly not for "commercial purposes" (ch VI). When the hens are called upon to release eggs they cannot agree and so they cause a mini rebellion of their own but, when Napoleon refuses to feed them, they can only hold out for five days at which point they go back to their nests. In the meantime, "any animal giving so much as a grain of corn to a hen should be punished by death." Napoleon upholds this decree and several hens are dead.
As the image of Snowball as a traitor intensifies, the animals are also led to believe that he is sabotaging the farm. There are rumors that "the rats, which had been troublesome that winter, (are) also...in league with Snowball" which adds to Napoleon's cause. He convinces the animals that "Snowball's secret agents are lurking among" (ch VII). When four pigs have their throats torn out by the dogs, supposedly because they had helped Snowball, there can be no disputing Napoleon's intent and the animals which witness this terrible sight are sufficiently terrified as to not give Napoleon any more trouble. The animals themselves "did not know which was more shocking--the treachery of the animals who had leagued themselves with Snowball, or the cruel retribution they had just witnessed." Boxer's solution is to "work harder." The animals can only take solace in the belief that life was worse under the humans and so the animals are defeated and not even permitted to sing "Beasts of England."
Remember that 'Animal Farm' is not just a fable about animals but an allegory to the Russian revolution. Napoleon represents Stalin, so his execution of animals would correspond to the political purges of the Bolsheviks once they gained control.
For a more complete study, please see the reference below.
Napoleon decided to excecute animals because he wanted to make the animals fear him. The fear of being killed would have been great enough for the animals to keep on believeing and trusting in Napoleon and not rebell against. Napoleon executed them based on the fact that they had tried to be spies and and had worked with Snowball. Hence, Napoleon tried to make the animals feel that they were always vulnerable and they had to work with Napoleon so that they would not be back in the control of Mr Jones. Napoleon wanted the animals to know that if they tried to rebell against him and work with others, they would be killed for it and hence the fear of being executed was the deterrance against rebelling against Napoleon. Hence, Napoleon would remain in control of Animal Farm.