Mallory traveled back in time to kill a young Michael.
As we theorized last week, Mallory was indeed the key to ending Michael's reign and reversing the apocalypse. Thanks to a series of intricate plans laid out by Cordelia, Coco and Mallory had their memories altered, were disguised as regular people, and were sent to Los Angeles, where Madison -- posing as an Uber driver -- delivered them to Gallant's salon.
The idea was to protect the girls with Coco's family money, assuring their place in Outpost 3 (with a little magical assistance from Myrtle), and for Coco to treat Mallory terrible to suppress her powers. Everything went according to plan, and the events as they happened in the first three episodes played out offscreen. Eventually, Cordelia, Myrtle, and Madison -- who survived the apocalypse by burying themselves in the powerful Louisiana mud outside of Misty's shack -- arrive at the outpost, resurrect their girls, and continue with their initial plan: For Mallory to perform the incantation that will send her back in time.
From there, things get a bit messy. Marie Laveau returns from Hell to help the coven, but Michael is too powerful to contain. He kills Madison, Coco, and Marie, while Coco's mutant ex Brock appears and stabs Mallory to death. Cordelia is unable to revive Mallory, so she confronts Michael, utters the best line of the season ("Satan has one son, but my sisters are legion, motherfucker!") then slits her throat so Mallory can assume her powers.
It works. Mallory wakes up in a bath and is able to transport herself through the water back to Michael's childhood, on the day he magically aged a decade overnight and killed the priest Constance brought in to bless him. In this version of the timeline, Constance doesn't give in to Michael, and kicks him out of her home after bitterly dressing him down. Michael runs into the street, clearly upset, and is struck by a car, with Mallory behind the wheel. She runs him over several times, and Constance rushes to his side. As he bleeds out, his legs twisted in various directions, he asks his grandmother to take him into the Murder House so they can live together forever. "Go to hell," she replies, and walks away, letting him die.