When a television show has been on the air for a few years, it's easy to become attached to the characters, and for regular viewers to consider them something of an extended family. Because you can't choose your family, as they say, but you can choose who sit down in front of the tube and watch for 30-60 minutes each week.
So it tends to be a little troubling when one of your favorite characters is killed off. (With the exception, perhaps, of fans of The Walking Dead, who should be used to it by now.) Substantially more heartbreaking, though, is when you learn that the character you've grown to love was killed off because the actor portraying that character died in real life.
Some series choose not to dwell on this, briskly removing the character for ludicrous-but-emotionally efficient reasons, such as having the character take that long (LONG) trip to Bangkok they've always wanted, or if the show takes place within a specific realm of employ, by having the character suddenly transferred elsewhere.
But the best showrunners know that it's often more appropriate to address these real-life deaths head-on, rather than trying to gloss it over. After the reports have come out about the nature of the actor's death and the proper statements have been made by those who work on the show, a tribute episode will follow. This onscreen grieving and eulogizing is often heartbreaking for audiences, but befitting of actors who spend so much time working in the medium.