Orville Peck began writing "Legends Never Die" as soon as he learned that Shania Twain was a fan of his music. The two hadn't decided to work together yet, and part of him thought that his hope of collaborating with the legendary artist was nothing more than wishful thinking.

"I started writing this song with her in mind. But kind of with something in the back of my head that told me it was never going to happen," he admitted during a recent conversation with The Boot. "But I just did it anyway -- as a pipe dream, I suppose."

However, that pipe dream wound up coming true. Twain agreed to duet with Peck on the track, and he even visited her at her ranch in Las Vegas, Nev., where the two spent a day with her horses, riding and perfecting the lyrics of "Legends Never Die."

"I wanted to have her input on it lyrically, of course," he continues. "Because I felt like it was such an incredible opportunity to not only do a duet with her but have her collaborate on it: lyrically, thematically. So she wrote a bunch of lyrics in her verses."

In fact, Twain fans might notice that some of her lyrics in "Legends Never Die" sound a little bit familiar. "She even threw in a couple little nods to iconic other songs of hers -- lyrics that she's had in previous songs," Peck hints.

"I love that kind of stuff," he adds, "that Shania fans can maybe pick up on some things that we put in there to pay a nod to her career."

Of course, Peck is a longtime fan himself: He's long been open about being inspired by iconic country performers as a kid, and Twain falls squarely into that category. He knew when he went to Twain's ranch that he was meeting a hero; what he didn't know was how much Twain would find new ways to inspire him after they met in person.

"I got a lot of beautiful insight into her as a person, as an artist," he reflects. "I got to learn that she still is and always has been, throughout her career, so hands-on. With her music videos and her songs, and her outfits and her styling -- everything is so much from her own creation. She was so in charge of all of it."

As an artist who counts his theatrical aesthetic as an important aspect of his artistic identity, Peck could relate. "That was really inspiring because I like to be the same way with what I do," he adds. "[It was so incredible] finding out that this person who has inspired you for so long can continue to inspire you in new ways."

Peck dropped "Legends Never Die" on Friday (Aug. 14), along with the rest of his six-track EP, Show Pony.

Who Is Orville Peck? 5 Things You Need to Know