Shelley sets up the poem as the narrator's reminiscence of a comment made by an anonymous "traveller" who describes the ruins of a once magnificent statue somewhere in the desert.
The traveller tells the narrator of a ruin he has seen of a fallen statue, with "two trunkless legs of stone" in one area, and nearby, "a shattered visage lies," that is, the head and face. More important, we learn that the whoever sculpted the statue must have known and understood the character of his subject because he was able to capture the "wrinkled lip, and sneer of cold command" of Ozymandias. In other words, the traveller is clearly looking at the fallen monument to a once great, powerful, commanding person.
When the traveller quotes Ozymandias' words--"My name is Ozymandias, King of Kings: Look on my works, ye Mighty, and despair"--and then contrasts the words with the setting, the desert where empty sands stretch to the horizon, the theme becomes clear.
Ozymandias, obviously once a powerful king, whose facial features indicated a commanding personality, is now merely a lonely ruin in the desert. His words, meant to inspire awe in anyone looking upon his magnificent statue, now point up the irony of power and greatness--no matter how much power one has in life, in death that power comes to nothing. Even the location where the traveller finds the statue is part of the irony, a nameless spot in the desert, with sand stretching to the horizon, remarkable only for the ruined statue of a once-great king.