Pam Beesly (Jenna Fischer) ultimately ended up with Jim Halpert (John Krasinski) in The Office, but not before getting back together with her ex-fiancé, Roy Anderson (David Denman). Pam and Roy, who were high school sweethearts, were together for a good portion of the NBC sitcom's first three seasons. Her connection to co-worker Jim, however, was teased from the start. When Pam and Jim eventually got together romantically ahead of season 4, and their relationship was a major focus until The Office ended with season 9. Despite the inevitable fate of the two characters, there was actually a deeper love between Pam and Roy than originally thought.

By the time The Office started, Pam and Roy were dating for eight years and engaged for three years. Though Pam was more than ready to finally set a date, Roy seemed content with the long-term engagement. She eventually grew closer to Jim as the two bonded over workplace shenanigans and pulling various pranks on Dwight Schrute (Rainn Wilson). After Jim made a move on Pam by kissing her in season 2's "Casino Night," Pam had conflicting feelings. In the end, she decided to call off her wedding due to cold feet, but the separation with Roy didn't last long.

Related: The Office: Jim & Pam's Wedding Originally Had An Insane Roy Twist

Following the "Casino Night" incident, Jim transferred to another Dunder Mifflin branch, while Pam remained in Scranton. Roy let his life spiral, but he vowed to win his longtime girlfriend back. It wasn't until Phyllis' wedding in The Office season 3 did Pam and Roy reconnect. Shortly after, the pair officially started dating again since Pam was led to believe the relationship would be different this time around. Of course, she learned to regret getting back together with Roy after he had a meltdown discovering the past kiss between Pam and Jim. In fact, he even tried to assault Jim at the workplace, resulting in being fired as a warehouse worker. Pam was questioned by viewers for why she attempted to return to Roy, especially with her clear feelings for Jim, but it was more complicated than a typical love triangle.

While Pam's short-term reconciliation with Roy served as another bump in the road that linked Pam and Jim, it was more than just a season 3 subplot. There was no doubt that Pam always had feelings for Jim. Still, Pam had a long history with Roy, which was presented in The Office. According to Fischer (via Brian Baumgartner’s podcast, An Oral History of The Office), she invented an entire backstory of Pam and Roy's origins involving their relationship. She decided her parents owned an appliance store that Roy worked at when they were teenagers, meaning they spent a lot of time together. Fischer then explained why her character went back to Roy by stating, "it’s not easy for her to get out of that relationship and just go to Jim."

The Office star also made it a point to explain how much viewers didn't get to see regarding Roy. Despite not having strong chemistry like the case with Jim and Pam, Fischer assured fans that her character truly loved Roy. Just because they broke up, Pam couldn't let herself immediately start dating someone else. She eventually embraced her feelings for Jim, but by then, he was with Karen Filippelli (Rashida Jones), so she returned to an established relationship with Roy. Thankfully, she used recent life lessons to end the relationship for good, but not before giving it one last try with who was presumably her first love.

More: The Office: Why Kelly, Ryan & Toby Really Had To Sit In The Annex