Let's say you got a part in a play. The character allows you to act like someone completely new, someone more adventurous than you, or more dramatic or eloquent than you.
In the play, your character falls in love, or conquers the world, or invents something amazing, or simply has an interesting experience. The character speaks in gorgeous poetry, or makes jokes that make the audience laugh uproariously, or reveals profound truths about what it is to be human. The character is happy, and lifts those around him, or sad, and fills the theater with deep emotion. You earnestly do your best to inhabit him and bring him to life and be faithful to him.
Toward the end, your character dies. You play the death (so dramatic!), and the other characters (and the crowds sitting in the dark) are very sad, but the play continues, with events strongly affected by your character, even though he's no longer present.
How would you answer if someone asked you "What's the purpose of playing that part, if your character ended up dying?"
As I wrote a few weeks ago, "Maturity is the correction of the misconception that you're the protagonist in this drama. You're not. You've never been. You're a character actor, briefly adding your bit of unique color to the action. The evidence which accumulates to prove this only feels harrowing for those who insist on clinging to the misconception."