The musical gets rid of this part, but Éponine literally arranges to get Marius killed because he rejected her.
She’s been in full “If I can’t have him, no one can!” mode since foiling the robbery. She’s manipulated Jean Valjean and deceived Cosette to keep her away from Marius, and she’s sent Marius off to the barricade to die. She does throw herself in front of the bullet meant for him…but she says it’s because she wants to go first. It’s sort of a Rube Goldberg murder-suicide by cop.
This is not romantic. It’s villain territory. Reading it a few days after the Santa Fe school shooting (the killer had reportedly harassed and been rejected by one of the girls he shot) brought it into starker relief.
While she’s been helpful in the past, at this point she’s following in her father’s footsteps: the same sense of aggrieved entitlement, manipulating people from the shadows, and seeking revenge for perceived wrongs. But while her father’s too stubborn to give up, her life has been so awful that she has no hope left. The same desperation that allowed her to stand up to Patron-Minette leaves her feeling that there’s nothing left for her once she gets rid of Marius. The best she can hope for is that they’ll be together in death.
When Éponine is first re-introduced as Marius’ neighbor, she’s presented as someone who could have gone a different way, but the world had already started to grind her down. There’s no indication that either of her parents could have turned out better people, but we do get the sense that she could, under better circumstances. Her brother did, under similar deprivation but with more freedom. And since their parents neglected him to begin with, he didn’t see them as role models.
She’s fifteen, so she feels everything acutely. But she’s also world-weary. She has no hope of a future any better than the misery she’s lived through, and in fact there’s a good chance things will get worse for her if she survives.
In the musical, Éponine’s death is a tragedy. In the book, her tragedy has already unfolded, and her death simply completes it.