Napoleon drives Snowball from the farm when the latter is at the height of his popularity and power. He perceives that Snowball is a rival, and wants him out of the way, so he begins to have the sheep bleat "four legs good, two legs bad" in the middle of his speeches, and eventually, when the issue of building the windmill was about to come to a vote (Snowball being its main proponent), Napoleon used the attack dogs he had raised to chase Snowball away.
Once Snowball is gone, we see how Napoleon is able to use the power of propaganda to essentially paint Snowball as the enemy of Animal Farm. Squealer, his propaganda minister, is instrumental in this. He claims that Snowball had been a traitor to Animal Farm all along and that Napoleon had only pretended to oppose the windmill (which, with Snowball gone, he claims as his idea) in order to expose Snowball as a negative influence on the farm. Before long, Squealer blames Snowball for everything that goes wrong on the farm. When the windmill blows down, it is claimed that Snowball was somehow responsible. Soon the animals make themselves believe that Snowball is sneaking on the farm to sabotage it. Napoleon's bloody purges in Chapter Seven are ostensibly because some of the animals have been declared (some even declare themselves) in league with Snowball.
In short, Napoleon uses the supposed threat that Snowball poses to add to his own powers by creating a sense of constant emergency. Snowball does not really pose such a threat, and we can see as readers that Napoleon is completely fabricating Snowball's treachery. But he manages to make the animals hate his former comrade through the skillful and devious use of propaganda.