Born Erik Lehnsherr, Magneto was a survivor of the Holocaust. At some unknown point he met and befriended Charles Xavier, and helped him build Cerebro. Believing humanity would never accept mutantkind, he became angry and vengeful. He and Charles went separate ways, and Magneto gathered the mutants Sabretooth, Toad, and the shape-changing Mystique (whom he would take as his mate), and formed the Brotherhood of Mutants.
On the eve of passing the Mutant Registration Act, Magneto contructed a machine which would theoretically evolve humans into mutants. The machine drew it's power from him, and almost killed him when he tested it on Senator Robert Kelly. Therefore, he planned to kidnap Rogue, transfer his power into her and use her to power the machine. He succeeded in capturing Rogue at the Salem Train Station, and prepared to unleash his plan: to take the machine to Liberty Island disguised as the Statue of Liberty's torch and mutate all the world leaders meeting on Ellis Island, forcing them to make the mutant cause their cause. (He was unaware- or may not have cared- that the mutations were unstable, and would kill the newly transformed world leaders within a few days.) The X-Men showed up and managed to defeat him.
Magneto was arrested and placed into a plastic prison in Washington which was constructed and run by General William Stryker. Magneto was kept in the prison for several months, and drugged and tortured by Stryker for information on constructing his own Cerebro, and the location and truth about the Xavier School for Gifted Youngsters.
Magneto was then used as bait to lure Xavier into a trap. When Xavier and Cyclops visited Magneto for information, the prison was gassed by Stryker's men and the two X-Men were captured. However, Magneto was still awaiting his moment of freedom and it came thanks to Mystique, who drugged one of the guards at a bar and injected his blood with extra iron. The guard entered the cell to bring Magneto his food, and Magneto detected the iron in his blood. Tearing it out of his bloodstream, Magneto transformed the iron into bullets that he used to shatter the prison, kill the other guards, and escape.
He met up with Mystique and headed towards the X-Mansion in time to rescue the X-Men from being blown out of the sky. Magneto and Mystique formed an alliance with them, and he explained Stryker's plan to use a new Cerebro, plug Xavier into it to connect to all their minds and kill them all at once. They made their way to Stryker's base at Alkali Lake, where he and Mystique helped infiltrate the base.
Both were the first to make it to Xavier, who was being controlled by Jason Stryker, a mutant capable of illusion. Immune to Jason's powers thanks to his helmet, Magneto stopped Xavier from killing all mutant kind, and had Mystique (in the form of Stryker) order Jason to have Xavier wipe out all human kind instead. Magneto and Mystique escaped, and on their way out, Magneto crucified Stryker to a wall, leaving him to drown when the base's dam burst. He left in Stryker's helicopter with his new recruit, Pyro. Magneto has not been seen since, but it is unlikely he will stay hidden for very long.