The reason for her departure was a contentious relationship with the producers and her co-stars. There were reports of on-set conflicts and disagreements about her character's direction.
Although Doherty was not in the final episode, her character, Prue Halliwell, was killed off in the opening scene of the season 8 premiere. This allowed the show to continue with the remaining three Halliwell sisters, played by Holly Marie Combs, Alyssa Milano, and Rose McGowan.
The final episode of Charmed, "Forever Charmed," focused on the closure of the Halliwell sisters' story and the legacy of their magical lineage. While Doherty's absence was a notable one, the show managed to wrap up the story in a satisfying way for fans.