A snippet of the song first appeared on the cartoon in 2014. Peter Michail, a director and producer on Teen Titans Go!, was directing an episode called "Slumber Party" when he came up 10 seconds short.
It's important to note that Teen Titans Go! does not have its own composer. There's no person on the Warner Brothers lot conducting an orchestra along to the cartoon. Instead, directors have to score their own stuff using whatever they can find in their in-house music library.
"That whole episode, I was scoring it with an '80s vibe," says Michail. "So I literally went into the '80s rock genre and [was] rummaging through these albums and found ["The Night Begins to Shine"]. I was like, 'Aw dude, this song's awesome!'"
And that's how you get Cyborg — one of the Teen Titans — singing along to B.E.R. in the beginning of the episode. He sings a few lines — and then promptly turns out the lights and goes to bed.
That was it. It was, the producers admit, a throwaway joke to fill time. But fans heard it differently.
"Off that episode, people started saying, 'What's this song? Is this a song I've heard before?'" says Teen Titans Go! executive producer Michael Jelenic.
So the show's producers decided: You know what? This song rules. B.E.R. rules. In the next season, it became Cyborg's favorite song — even if fellow Titans didn't agree with his taste.
The song's popularity grew online. On YouTube, fans started playing the song over other cartoons. Next came remixes, and that sure-sign symbol of an online hit: hour-long loops.
This month — and here's where that corporate overlord plotting starts to kick in — Cartoon Network decided to go all-in and air a four-part series about the song. They released an EP. They commissioned covers from musicians like CeeLo Green and Fall Out Boy.
And that's how B.E.R ended up on the rock charts, beating out radio rock bands The Lumineers and Muse.
Carl Burnett, the "B" in B.E.R., helped write and produce the song. He's the one who got the assignment in 2005 to write an '80s-style song for a music library. And he's as surprised as anyone by its success. "Who would think it from a song that has its roots as a music library track?" he says.
I asked him what it was like to have an accidental hit — which, admittedly, is probably not the best way to phrase a question to a songwriter. Luckily, Burnett wasn't offended.
"Hmm, accidental," he says. "I would say that it's miraculous."
Copyright 2017 NPR. To see more, visit http://www.npr.org/.