Magneto, real name Max Eisenhardt (alias Erik Magnus Lehnsherr), is a Marvel villain that frequently appears in the X-Men universe. Magneto is known as the "master of magnetism" because his mutations give him the ability to manipulate, generate, and control magnetic fields. Magneto first appeared in 1963's Uncanny X-Men #1 and his origin story was told in 1987's Classic X-Men #12. Through these two books we learn about the life of Magneto as Max Eisenhardt.
As a child, Max's parents were murdered by Nazis and he was sent to Auschwitz concentration camp where he was forced to help the Nazis operate the gas chambers, ovens, and fire pits. Max was known as Prisoner #214782.
Max falls in love with a woman named Magda during his time in Auschwitz and they survive the Holocaust together. When they are free, Magda gives birth to a daughter named Anya. Max was unable to consciously use his mutant powers until, in Classic X-Men #12, his family is trapped in a burning house. Max rescues Magda but cannot save his daughter. Furious that the townsfolk did not step in to help, Max unleashes his power and murders them all. Magda leaves him, terrified.
Max took the name of Erik Leshnsherr in an attempt to start over and lose his pursuers. He takes up work at a hospital in Israel, working as an orderly. It is at this point in his life that Magneto becomes friends with Charles Xavier. Magneto continues to hone his powers in secret, unknowing that his new friend Charles is also a mutant.
War criminal Baron Wolfgang Von Strucker attempts to collect a large cache of Nazi gold. Charles and Erik (Magneto) team up to stop him. This is the first time the two friends reveal their true nature, as mutants, to one another. Their actions cause a cave in that allegedly kills Strucker and Magneto, realizing that he and Charles have very different views, steals the gold for himself.
Magneto, fearing another holocaust, begins aggressively preparing for a war between mutants, whom he calls homo sapiens superior, and humans. His actions throughout the X-Men Universe have been, in his mind, for the betterment of mutant kind.