There is a very real sense in which Shelley uses the death of his friend, Keats, to write a poem that is not so much about him and not so much an elegy of his life as a reflection on Shelley's own thoughts and feelings about life and death. It is very clear that although the poem starts with the physical fact of the death of "Adonais," the mythical figure Shelley picks to represent Keats, as the poem develops, it begins to focus more and more on Shelley's own position and the identity of humans, and the poem thus shifts from remembering the life of Keats to the struggles faced by those he leaves behind:
'Tis we, who lost in stormy visions, keep
With phantoms an unprofitable strife,
And in mad trance, strike with our spirit's knife
Invulnerable nothings.--We decay
Like corpses in a charnel; fear and grief
Convulse us and consume us day by day...
The speaker of this poem explicitly compares the peace and tranquility that Keats experiences now that he is dead and "awakened from the dream of life" to the suffering and hardship faced by those left behind, who have to face the tragic results of decaying day by day "like corpses in a charnel." It is fair to say therefore that this poem uses the death of Keats as a springboard for the poet to consider more his own life and struggles.