Kate is Janet's best friend since forever, and Wendy's grown up knowing her as a kind of adopted aunt. She knows she can always rely on Kate to be there to take care of her and her mother; after all, Kate is the one who let them stay with her when Janet finally left Garrett.
After Janet's death on 9/11, Kate continues to visit with Josh and Louie, even after Wendy leaves for California. She just wants to make sure they're doing okay and offer support. One thing leads to another, though, and soon she finds herself romantically involved with Josh.
Wendy is a bit disturbed when she first learns about this, but she soon comes to understand that Kate and Josh are both hurting super badly. They just need some human comfort, someone to talk to who understands the depth of their grief and loss. In the end, Kate is so overwhelmed by her grief that she needs to leave New York City. She comes to see Wendy before she moves to Hawaii, though, and explains why she's going:
It was never a choice so much, she said. More of a habit. Your mom was there, and you guys. Which was basically my family. Only it wasn't completely, which is what I came to see. I was borrowing your mother's life.
We liked having you around. You were the best friend my mom ever had. Way more like a sister than Aunt Pam.
I know, she said. But your mother's not there anymore. (32.150-152)
It's clear that Kate isn't the enemy and isn't trying to betray Janet's memory by being with Josh. She's just trying to survive Janet's death—like they all are.