While other superheroes were busy clobbering the bad guys, the X-Men were fighting persecution, segregation and prejudice. When the X-Men were introduced in the 1960s, many saw them as a metaphor for the civil rights movement.
By the time the movies came out, there was a shift to being more of a gay allegory. There's actually a scene where Ice Man "comes out" to his parents about being a mutant. His mother asks, "Have you tried...not being a mutant?" Subtle.
You could argue that homosexuality is an appropriate metaphor. Unlike race, we can't tell if somebody is gay by looking at them. The same is true of the mutants in the Marvel universe. Most mutants look like other people, and many can keep their powers hidden their entire lives.
The first X-Men movie was filmed in Toronto, Canada in 1999. This film was one of the first superhero movies that many fans believe faithfully adapted the maturity of comic books to the big screen. Prior to X-Men, we had movies like Batman & Robin, that had the maturity of a Saturday morning breakfast cereal commercial.
In the Marvel universe, most mutants are treated as freaks. Most parents disown their mutant children and this leads many to pursue lives as outlaws.
Enter Charles Xavier. Professor Xavier is a mutant who wanted to help mutants. He created Xavier's school for gifted youngsters. The school's motto is mutatis mutandis, which is Latin for " "the necessary changes having been made" or "once the necessary changes have been made." The mutants are the next step in human evolution, and in the Marvel universe there continues to be more and more of them.
At Xavier's school, the faculty are also mutants. While they all have birth names, many are also known by mutant aliases. Cyclops has destructive laser eyes and must wear a visor at all times. Storm has the power to conjure powerful storms at will. Jean Grey goes by her given name and holds the power of telepathy and telekinesis.
The X-Men can be read as an allegory for any minority group. This is particularly poignant for Magneto, who was a prisoner of German concentration camps.
The idea to make the X-Men mutants came out of Marvel comics writer Stan Lee's frustration with having to give every character an origin story. The X-Men were also unique in that they were the first superhero team to have been "cursed" with their powers and persecuted because of them.
Spider-Man was bitten by a radioactive spider against his will, but he soon embraced his new abilities. The Fantastic Four are another example, who also soon embraced their powers. The Incredible Hulk was in some ways the result of Banner's own hubris. Mutants like Rogue and Nightcrawler are born with their superpowers and feel alienated from society because of them.
In the 2002 film X-Men: United, Nightcrawler reveals scars he sustained from people who considered him a freak, and grew up hating and fearing humans as a result. Nightcrawler's religious devotion comes from the fact that God loves all of his creations.
In the case of the X-Men, their superpowers make them a minority group. The appeal of most superheroes is that they are above humanity, and that they are revered for their skills. For the mutants of the X-Men comics, their powers actually make them weaker and put them in a position of vulnerability.
Magneto, who has the power to control magnetic fields, is also a Holocaust survivor. His experience with the Nazis led him to distrust humans and is convinced that human beings will always persecute people they are afraid of. For Magneto and his Brother of Mutants, humans are mortal enemies of mutants. Kill them before they kill you.
Wherever Magneto is, Mystique is not far behind. Her mutation allows her to physically morph into anyone she wants. Mystique can even imitate voices. Her real form is a woman with blue skin and yellow eyes. She was persecuted for her natural appearance in her youth and so she shares Magneto's distrust of a human/mutant alliance.
The X-Men believe that humans and mutants can and should learn to live together in peace. Some might call the X-Men similar to Dr. Martin Luther King in their philosophy, with the Brotherhood of Mutants following a Malcolm X philosophy.
It's been many years since the first X-Men movie was released. X-Men: Apocalypse is presumed to be the last X-Men film for quite some time, but X-Men will never lose their relevance. There will always be a group being marginalized, whether for their race, sexual orientation, and the X-Men will always be the shining allegory to remind people of the sin of prejudice. ~Yanis Khamsi