The whole finale episode juxtaposed real-time events with Sasha's fever dream. Captured by the Saviors, she had no choice but the align with Negan for his sinister plan to entice the Alexandrians into submission yet again. Thanks to her stoicism, she'd been able to wrangle a suicide pill from Eugene, who'd previously made them at the request of other ladies in the Saviors ranks. Once she decided against using it to end her suffering in the cell, though, Eugene assumed the pill was ancient history and guided Sasha to do her worst for Negan.
Negan intended to use her for bait, carting her to Alexandria in a coffin so as to bring her out in dramatic fashion once he'd inevitably gotten the upper hand. All the while, Sasha was sweating bullets and listening to Donny Holloway's "Someday We'll All Be Free" on the MP3 player Eugene gave for the ride, envisioning a conversation with Abraham about their role in stepping out as the sacrificial lamb for their friends. In the end, Abe reminds her that they're doing what they do to provide a future for the next generation, like Judith and Maggie's baby, and so she suits up to say goodbye to her safehouse. That's when she dies, we have to assume, and is transformed into a zombie before Negan can open the hatch of her coffin for a surprise attack that might buy her friends some time and provide a critical distraction. She'd agreed to just one Alexandrian death in the transaction with Negan, and by golly, she made good on that end of the deal.