Sometimes they leave for personal reasons such as to be with their families. And sometimes, as with the recently late and great Luke Perry, they leave the show because they have left this world behind.
Related: Enjoy Unlimited access to thousands of Movies and TV shows with Amazon Prime Video. Watch Anywhere. Cancel Anytime!
But the show must go on. When an actor wants or needs to leave a show, the writers have to cook up a reason for their departure. They might kill the character off, have the character move away, or they might simply replace the actor.
Seeing a new actor playing a beloved role can be unsettling but also intriguing.