There are many different takes on how zombies are created, depending on the source. Traditionally, it was believed that zombies were created thanks to someone practicing Voodoo and using it to raise corpses from the dead. In reality, corpses raising from the dead was because they weren't really dead - simply in a coma-like state. In modern times, some still say that this is the case, and so in the media there are cases involving zombie lords of some kind controlling hordes of zombies.
In probably the most popular series of zombie horror movies - both versions of Night of the Living Dead, the original Dawn of the Dead and Day of the Dead by George A. Romero - zombies are primarily created thanks to attacks on humans, in which the humans are bitten. Once bitten (it was also hinted that even a simple scratch from a zombie would have the same effect), it seems that the infection which creates zombies is passed on, and the infection slowly begins to weaken the human to the point of death, or possibly the damage done by the zombie was enough to cause death normally. Once dead, presumably the same virus re-animates the corpse and a new zombie is created. It also seems from these films that zombies can be created from a person dying normally (unless they die from head damage). This suggests that the initial zombie outbreaks were due to corpses being re-animated.
The new Dawn of the Dead makes the cause of zombification exclusively the passing on of an infection from a zombie to a human, removing the more supernatural aspect of zombification. Zombification also seems to slow or completely stop the decay of flesh, which would suggest that zombies could continue to operate for years after death. Other sources have zombification being as a result of toxic waste, virii, etc., which can be spread in various ways. The popular Resident Evil series of games has an artificial virus creating zombies, for example.