The ending shows Charles and Erik turning one shared mission into two opposing movements, and it explains how the rivalry of the original films began. In the final stretch, Erik takes the name Magneto and leaves with a group of mutants, including Raven, who chooses to follow him. Charles, now in a wheelchair, turns his family home into a school for young mutants.
In my opinion, the key moment is the showdown in Cuba, because that is where the film makes the split feel earned rather than announced. Erik has just killed Shaw with the coin Shaw once used to test his power, so the revenge that drove him since the camp in 1944 is finished. Then human navy ships fire on the mutants, and Erik turns the missiles back on them. Charles, who still believes in peace, steps in and is hit by a stray bullet, which leaves him paralyzed. It could be argued that the bullet is both literal and symbolic, since Erik's anger costs his friend the use of his legs.
The film also loops back to its own opening. The boy who bent a metal gate with his mind while his mother was killed is now a man who bends missiles, and the lesson he took from Schmidt is that humans answer mutants with force. Charles has the opposite lesson, from a childhood where he took in Raven without fear. Seen that way, the ending is less a betrayal than two reasonable readings of the same evidence, which is why I find the split more tragic than the villain plot.
Moira stays in Charles's life, but he erases her memory of his location to protect the mutant cause. Perhaps that is the saddest beat in the film, since it cuts off a human ally who knew them from the start. Raven's choice matters just as much. She follows Erik because he tells her to stop hiding, and that is a point about identity, not a romance as far as the story shows. It leaves her on the path to Mystique, the role Romijn played in x men 2000.
Compared with the other films in the saga, this ending is unusually clean. x men days of future past has to reopen the wound in 1973, with a young Charles who has lost his telepathic powers to a drug that lets him walk, while x men apocalypse and dark phoenix keep the school and the rivalry going. The result is a pair of former friends left as opponents, which sets up the conflict of the original X-Men films. For where the film sits in story order, see the x men timeline.