The CW

By all accounts, 2015 was a make-or-break moment for musical shows on television. Glee finally fizzled out, three years after The Atlantic’s Kevin Fallon declared that “the TV-musical experiment has failed.” In his 2012 piece, Fallon argued that campy programs such as Glee and Smash had squandered their promising starts, dropping in terms of both quality and ratings. Smash ended in 2013 after just two seasons, but Glee kept trying in vain to recapture its old magic. When the show finally wrapped, in March 2015, it was easy to conclude that if a TV musical watched by more than 13 million people in its prime couldn’t make it, nothing else could.

Mere months later, Crazy Ex-Girlfriend arrived on The CW. A fresh take on the comedy musical, the series introduced Rebecca Bunch (played by Rachel Bloom), a high-flying lawyer and self-proclaimed feminist. At the start of the show, she uprooted her life in New York to follow her childhood crush, Josh Chan (Vincent Rodriguez III), to his Southern California hometown in search of happiness. The show has received praise for its nuanced and funny portrayal of Rebecca, whose self-destructive and narcissistic tendencies were later revealed to stem from borderline personality disorder. (Bloom, unsurprisingly, won a Golden Globe for her fantastic lead performance.)

When Crazy Ex-Girlfriend ends Friday, after four stellar seasons and more than 150 songs, it’ll be remembered for reviving the TV-musical experiment. But the show also deserves praise for allowing its musical format to evolve alongside its protagonist. Just as Rebecca has transformed from a chaotic, selfish mess into a more compassionate, empathic person learning to live with mental illness, so too have the show’s song-and-dance numbers come to reflect the new, more liberated perspective of its heroine.

Rebecca’s mental-health struggles have been at the heart of the show from the very first episode, in which viewers see the character tip pills into a garbage disposal while listening to a voicemail left by her mother, berating her for a previous suicide attempt. Rebecca later tells her therapist that she likes to visualize her life “as a series of musical numbers,” because doing so allows her to escape from her overwhelming emotions and her unfeeling family. This framing device places Crazy Ex-Girlfriend’s musical numbers firmly in the realm of the imaginary—unlike many TV musicals, à la Glee, Smash, and Nashville, where the characters themselves are talented performers, a fact that’s meant to justify their regularly breaking into song.

By contrast, the star of Crazy Ex-Girlfriend isn’t a talented performer; in fact, in the world of the show, Rebecca is supposed to be a terrible singer. But she’s a stage enthusiast, which sets her apart from her peers in the suburban California town of West Covina. “I hate musical theater,” Rebecca’s roommate Heather (Vella Lovell) says in a recent episode. “People are talking and then they just start singing, and it’s always just like, what?” She’s got a point. A genre where groups of strangers spontaneously burst into song in the street, prompting the surrounding crowd to perform a carefully choreographed dance routine, requires a certain tolerance for earnestness and a suspension of disbelief on the part of the audience. Because Crazy Ex-Girlfriend makes the song-and-dance numbers an entirely imaginary manifestation of Rebecca’s mental state, viewers can more easily accept its musical elements.

Since the music in the show isn’t bound by a need to be naturalistic or rational, the songwriters have free rein to create gloriously silly, highly produced parodies with titles such as “I Love My Daughter (But Not in a Creepy Way)” and “I Gave You a UTI.” The pilot’s opening number, “West Covina,” exemplifies this joyful extravagance. The song is a hilarious love letter to Rebecca’s new town—complete with a marching band, a 35-piece orchestral accompaniment, and a huge synchronized dance performance—that ends with Rebecca suspended above the city on a giant pretzel. The number functions as an “I Want” song (a trope in musical theater that serves to lay out the protagonist’s desires), one that paints West Covina as “the Garden of Eden” because that’s where Josh lives, Bloom said. The cartoonish sparkle that Rebecca projects onto the mundane town is humorously ironic, but it also offers insight into how the character’s powerful feelings about Josh spill out into the world around her.

Bloom has previously described each of the show’s seasons as covering a different stage of the stereotypical crazy ex’s actions: “falling in love with someone, being obsessed with them, getting over them, and the path to recovery.” By the third and fourth seasons, Rebecca’s priorities have changed, and the show’s musical framework has shifted with them. After countless cycles of self-destructive behavior centered on Josh, Rebecca undergoes a psychological reassessment that leads to her finally being diagnosed with borderline personality disorder. As she waits for her evaluation results in the episode “Josh Is Irrelevant,” Rebecca sings “A Diagnosis”—a new “I Want” song in which she finally understands that she can find happiness only in herself. The next episode is the first in all three seasons not to feature Josh’s name in its title. By Season 4, the episode titles have dropped male names altogether, as Rebecca attempts to focus less on romance and more on herself.

Rebecca in recovery after her diagnosis is, as Arielle Bernstein writes for The Guardian, “more self-aware, willing to listen and learn, and ready to apply the skills she’s learned in therapy.” As Rebecca simultaneously looks within herself and listens to the people around her, her previously introspective solos are redistributed among the wider cast. In Season 4’s opening episode, viewers see this shift in “No One Else Is Singing My Song.” What begins as a self-indulgent ballad from Rebecca ends with 11 supporting-cast members singing along with her in perfect harmony, each character lamenting his or her own “super unique” problems. Because all of the show’s singing technically takes place in Rebecca’s mind, this ensemble performance suggests Rebecca is finally realizing that other people have always had their own issues—a noteworthy act of empathy on her part that illustrates how much she has changed.

From this point on, Rebecca takes a step back in the musical numbers, and the show offers six consecutive episodes in which she never sings the lead. Instead, fan-favorite characters who have previously been sidelined are given their own songs, with Jim (Burl Moseley) and George (Danny Jolles) starring in the kinds of slickly choreographed, elaborately costumed performances that Crazy Ex-Girlfriend is beloved for. “What U Missed While U Were PopUlar” sees George reflect on his high-school experience as a nerd, while Jim’s “Don’t Be a Lawyer” tears apart the notion of having a legal career (“There are so many other professions / That don’t turn you into Jeff Sessions,” goes one line.) That both of these songs, given their lyrics, could have once been performed by a miserable Rebecca only adds to the idea that she is seeking to move forward rather than dwell on the past.

That isn’t to say that Rebecca’s transition away from lead vocalist has been without its setbacks. Because her singing is intimately connected to her psychological well-being, her uneven journey of recovery is also mirrored in the musical numbers. When she faces rejection from a former flame, Greg (Skylar Astin), she slips back into her recognizable self-punishing behavior with “I’m Not Sad, You’re Sad,” a classic Rebecca-singing-to-the-camera solo number in which she snorts ibuprofen before drunkenly trying to have sex with her boss and Josh.

Although watching Rebecca return to old habits is frustrating, the audience also sees signs of her growing maturity. After the outburst, Rebecca goes to her therapist’s office in the hope of talking about her problems and seeking peace instead of chaos. Rebecca’s progress is also conveyed via throwbacks to songs from earlier in the series. In Season 2’s “The Math of Love Triangles,” Rebecca relished playing two love interests off each other; but in Season 4’s “The Math of Love Quadrangles,” which finds her torn among three men, she’s reluctant to get mired in the conflict. “I thought all this drama was back in my past,” she sings—a reminder that she is no longer the pill-tossing Rebecca of the pilot episode.

When it debuted, Crazy Ex-Girlfriend set itself apart from earlier TV musicals with its vivid sense of imagination and its willingness to celebrate, rather than explain away, the inherent ridiculousness of the genre. Given that the series became acclaimed, in part, for its Rebecca-fronted numbers, it’s been remarkable to see how the protagonist’s personal development has forced the show to evolve as well. As enjoyable as Rebecca’s performances are, in recent episodes, every one of them has been prompted by a return to her old behaviors; when she’s working to improve herself, other people get to take center stage.

This dynamic creates a dilemma for fans. It means that one possible outcome of Rebecca’s ongoing recovery is that she’ll stop imagining her life as a series of musical numbers. It might be fitting, then, that the show is concluding after Season 4, with Rebecca’s life seemingly on the upswing. Musical theater is, in many ways, escapism in its flashiest form, an indulgent departure from reality. As Rebecca continues to grow, she’ll begin to face life’s dramas in the real world, rather than on the private stage in her mind.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.