The genetics
As in all the X-Men films, the premise is genetic: mutants are people born with an inherited mutation, the X-gene, that gives them powers. This film adds two more specific genetic elements. The Sentinels of the future target not only mutants but also ordinary humans carrying the genetic potential to have mutant children, a nightmare version of genetic screening and persecution by ancestry. And the decisive weapon is built from Mystique's DNA: after her capture, government scientists study her shape-shifting genome to create machines that can adapt to any mutant power. Bolivar Trask, the weapons designer behind the programme, experiments on captured mutants and serves the military establishment, and the film presents his work as the route to genocide. The X-Men are often read as an allegory of minorities facing prejudice. Like the rest of the series, the film's genetics is comic-book fantasy rather than a depiction of real science.
The story
In a dark near future, robots called Sentinels hunt and kill mutants and the humans who could have mutant children. The surviving X-Men, led by an older Charles Xavier and Magneto, learn that the Sentinel programme gained its government approval after Mystique assassinated its creator, Bolivar Trask, in 1973; she was then captured and experimented on, and her DNA was used to make Sentinels able to adapt to any mutant power. Kitty Pryde sends Logan's consciousness back into his 1973 body to stop the assassination. Logan recruits the young, broken Xavier, Hank McCoy and Quicksilver, and they free Magneto from prison under the Pentagon. Mystique's attempt on Trask at the Paris Peace Accords is foiled, but the public exposure of mutants persuades President Nixon to approve the Sentinels. At their unveiling in Washington, Magneto turns the robots against the government, but Mystique, persuaded by Xavier, spares Trask and saves the President. The dark future is erased.