In the movies, stars get born in grocery store parking lots. But in real life, true starbirth happens during fifth-period algebra whenever a teacher promises a sophomore that their dreams won’t last five minutes outside the walls of their miserable high school.

It’s the stuff of a hundred rock memoirs (Roger Daltrey’s new one is titled “Thanks a Lot Mr. Kibblewhite”) and a thousand rap songs — the best being “Juicy” by the Notorious B.I.G., a rapper cool enough to make the climb to fame sound like an act of levitation. You remember his opening remarks: “This album is dedicated to all the teachers that told me I’d never amount to nothing.”

Now, nearly 25 years after “Juicy,” we need to thank a high school teacher in Arkansas for “Girl Goin’ Nowhere,” the second-greatest song ever written about this sort of thing. It’s by Ashley McBryde, a 35-year-old country singer whose debut album is up for a Grammy next month. But in a crowded field of musicians flipping birds at their math teachers from upon high, “Girl Goin’ Nowhere” feels singular. It’s the only song I’ve ever heard that accounts for just how bad it hurts to finally get to I-told-you-so.

And while this song is far more elegant and sure-footed than most paranoia anthems about haters, it springs from the same insulted source. During a big-hearted performance at the Hamilton in downtown Washington on Wednesday night, McBryde introduced the tune with the story that inspired it. Yes, she really harbored dreams of Nashville stardom way back in the 10th grade, and yes, she really had an algebra teacher who told her to “remember where you’re from.” McBryde said she wrote the ballad “in spite of that old bird.”

But once she started singing it, there wasn’t a fleck of spite in her voice. Instead, she drew the entire room into the song’s refrain. “The lights come up, and I hear the band,” she sang. “Where they said I’d never be is exactly where I am.” The first time through, she delivered those lines alone. But on the second go-round, a delicious nanosecond after they heard the world “band,” her backing musicians suddenly came alive. It was as if her lyrics had willed the sound into reality, like a magic spell.

As for McBryde’s voice, it was so wounded, so finespun, you might have mistaken it for a graceful kind of self-pity. She seemed to be holding tight to the pain of being doubted and disparaged, refusing to let it spill down the mountain she had scaled.

But by the time she reached the song’s bridge — “It took a whole lot of yes-I-wills and I-don’t-care/A whole lot of basement dives and county fairs/To this show right now, and y’all sure look good out there” — her voice signaled something else. The words “care” and “there” got caught on the way out, suggesting that this was a pain that couldn’t be let go.

It was one of those moments when a performance stops feeling like a performance. Here was a song about singing to a room — being sung to a room — but McBryde seemed entirely inside herself. Maybe that’s why it’s so lonely up at the top. You’ll always be the only one to ever know what it took to get there.