Pam Beesly and Karen Filippelli have a tense relationship when Karen accompanies Jim when they join the Scranton branch from Stamford. Pam harbors feelings for Jim but cannot act on them because Jim is dating Karen.
Pam initially suspects something between Karen and Jim Halpert when Karen gives him a stick of gum during their first conference room meeting. She is even more concerned when she sees Karen pat and caress his back as they return from Michael's failed team-building exercise. Her suspicions are confirmed when Jim tells her later that day that "I've sort of started seeing someone."
Pam realizes that she is being cold to Karen for no real reason and takes steps to be friendly towards her. Together they create the Committee to Plan Parties and organize a Margarita-Karaoke Christmas party, which is far more successful and attracts far more members of the office than the "Nutcracker" party thrown by the Party Planning Committee, which only Kevin, Cathy, Angela and Phyllis (later Dwight) attend. ("A Benihana Christmas")
Pam convinces Jim to relent and allow Karen to move to a rental home two blocks from Jim's place. She is devastated that her efforts to support her friend Jim serve to drive him into Karen's arms. She cries in a hallway of the building, and Dwight approaches her and comforts her, believing that she is having PMS-related mood swings. ("Back From Vacation")
After the sales team goes out on duo sales calls, Karen asks Jim whether he ever had a "thing" for Pam. He initially lies, saying no. She reminds him that she moved to Scranton to be with him, so he admits that he at one time had feelings for her ("Traveling Salesmen"). After Jim tells her this, she becomes more suspicious of Pam and her motives. After observing Jim and Pam pranking Andy to the breaking point, she asks Jim directly whether he still has feelings for Pam. Jim finally admits, "Yes." ("The Return")
The tension between Karen and Pam over Jim escalates. Karen and Jim tell the audience in separate interviews that they had been having long, emotional talks about their relationship and Jim's feelings about Pam. Karen begins hugging Jim more openly in front of Pam, and Pam notices that "something is weird with Jim." Pam, not knowing that Jim has admitted his feelings for her to Karen, approaches Jim when he is at the vending machine and tries to flirt with him, but Jim appears somewhat distant. Dwight, who has been ordered by Michael to order a stripper, asks Jim whether he should order a Redhead or a Brunette (the hair colors of Pam and Karen) to which Jim hesitantly replies "...blond". Both Karen and Pam look at Jim concernedly and then make eye contact before awkwardly looking away. Later, while talking in private, Karen tells Pam that Jim told her about the kiss. Karen says it's okay and that they talked it through. When Pam doesn't respond, Karen asks "Wait, you don't still have feelings for him do you?" To which Pam replies "Yeah!" and then swears she was confused by the phrasing of the question. She awkwardly tries to assure Karen that she is not into Jim, then apologizes. Karen asks what she's apologizing for, and Pam stumbles, clearly trying to hide her feelings for Jim. Later, Pam asks Ryan to set her up with one of his business school friends in front of Jim. ("Ben Franklin")
At Phyllis' wedding, Jim tells Pam that her dance moves are cute. In a solo interview, Jim says "Hypothetically if I thought Pam was interested..." and trails off, continuing "No, it's totally hypothetical." When he later sees Pam leaving with Roy, Jim then says in another solo interview "Here's a non-hypothetical: I'm really happy I'm with Karen."
At David Wallace's cocktail party, Karen plays a prank on Jim, telling him that she'd been in relationships with numerous other men at the party. When she finally tells him that she'd had an affair with David Wallace, Jim figures out that it was a joke. Karen is clearly insecure about their relationship, and when Jim leaves to go shoot hoops with David Wallace, it is unclear from his facial expression whether he actually thought her prank was funny, or is annoyed by it.
After finding out that Pam had kissed Jim after the Casino Night Roy comes into the office and tries to punch Jim, but is sprayed with pepper spray by Dwight and summarily fired. Kevin later asks Karen how she feels about Roy attacking her boyfriend over another woman, and she sarcastically replies "I feel great. Thanks Kevin." Pam apologizes for Roy attacking Jim, and tells him that she and Roy are completely done, but Jim seems not to believe her. It is clear that Jim is actually mad at Pam for rejecting his advances and breaking off the wedding, but then later getting back together with Roy.
On women's appreciation day, when Michael is getting advice about his relationship with Jan from the women of the office, Karen and Pam repeatedly give conflicting advice This is not only confusing to Michael, but subtly highlights the simmering tension over Jim between the two.
After Pam's speech on Beach Day ("Beach Games"), Karen says that "Pam is... kind of a bitch." after Pam insists she meant what she said at the beach about her feelings towards Jim ("The Job") and becomes more hostile toward her.
While Jim and Karen are interviewing for the coroporate permission at Dunder Mifflin, the prospect of moving away from Scranton and never seeing Pam again seems to become too real to Jim. In his interview, he discovers that Pam had placed the yogurt lid-medal and a note that said "remember us when you're famous!". At the end of the episode, he interrupts Pam in a solo interview and asks her to dinner. It is not clear whether he'd broken up with Karen at this point, but in the next episode she immediately leaves Dunder Mifflin Scranton, presumably transferring to the Utica branch at that time.
During Pam's visit to the Utica branch, she meets Karen, who is now married and far along in her pregnancy. The two are happy for each other, and Pam is relieved that there are no hard feelings between them. Later Pam tells Michael that she is glad that she got closure with Karen, which inspires Pam and Michael to go to Nashua to get closure for Michael about his relationship with Holly. ("Lecture Circuit Part 1")