When she offered to help Jim with his problem, she hadn't really meant that she wanted to help him. She was just trying desperately to get him to talk to her, because even after the months they had spent apart, he was still her best friend, and what kind of best friends don't talk to each other? So, kind of without thinking she goes, "You wanna talk about it?"
After he accepted her offer, she had that "Oh, shit" moment, in which you realize you're about to do something that you really, really don't want to do, and you have no way out of it. Trying to hide her wince as she sat down, he explained the problem to her. It wasn't as bad as she had expected. Actually, it was kind of nice, because Jim didn't want Karen near him. Pam didn't really qualify living two blocks away as living together, though, as Jim did, and she told him so. Again, without thinking. She hadn't really realized that this would lead to Karen getting what she wanted, and consequently, her living closer to Jim. Pam thinks it was probably the rush of adrenaline that merely talking to Jim now gave her that caused her word vomit. It was the first thing that popped into her head, so she said it. Now she was going to have to deal with the consequences.
The effects of her advice quickly left her mind, though, as soon as they got on the topic of Michael and Jan. Suddenly, they were in sync again, going back and forth in the banter they had perfected after years of friendship caused by working in this insane office. It was easy to forget that he had a girlfriend and that they weren't close anymore whenever they got going like this. She felt as light as air, as if every bad thing had been lifted off her shoulders, and she was free just to enjoy life. For the moment, anyways.
She left the break room still feeling insanely happy, all memories of the reason why she and Jim had started talking in the first place gone. His "Yeah, how have we not talked about this yet," was still floating through her head, making her feel as if he might just miss her just as much as she missed him.
She finds it kind of embarrassing to admit that she actually didn't remember that she had helped Karen until she comes up to Pam in the warehouse, offering thanks. It actually takes her a minute to realize why in the world Karen would be thanking her, but then she remembers with Karen's explanation, and suddenly the light feeling she had maintained throughout the afternoon is gone, and she's sinking into a hole of deep, dark depression. "Jesus," she thinks. "Did I actually help her get closer to the man I want?" As she sputters a response to Karen, she thinks that she's never felt this stupid in her entire life. She feels as if she's suffocating, and she has to get out of here. Out of this insane office where her judgment is impaired on a regular basis by a certain attractive salesman. Out of this job where she works with people she absolutely despises. Out of the presence of the one woman in the world who has caused Pam the need, the desire to scratch her eyeballs out.
So she turns away from Karen and flees, into a hallway, where she just collapses. How in the world did her life get this fucked up? If only she knew that that night last spring would screw up her life this much… Would she have done something differently?
She doesn't realize tears are falling down her face until Dwight shows up. She's embarrassed, but honestly doesn't care enough to try and stop her sobs. For a moment, she's touched by Dwight's compassion, and accepts his handkerchief. But then he reminds her why she hates him with his stupid little comment, and then she realizes that she is being comforted by Dwight, which brings on a new round of tears.
Again, she asks herself. "How did my life get this fucked up?"
