How is King Lear a metaphor for the frailty of mankind?
It is a metaphor for the frailty of mankind precisely because through its plot and the horrific suffering that Lear is forced to endure mankind is shown to be truly frail in the face of forces that are beyond its control and ability to comprehend. This tragedy, perhaps more than any other Shakespeare tragedy, is shaped by disasters that visit upon the characters catastrophic consequences. This can be related to the key theme of justice, and various characters in the play wonder about whether there is any such thing as justice, or if the world is antagonistic or even indifferent to humanity.
Gloucester, for example, draws the following comparison to the relationship between humans and the gods:
As flies to wanton boys are we to the gods;
They kill us for their sport.
Even though Edgar believes that "the gods are just" and maintains a belief in a view of the world where each person is punished or rewarded according to their deeds, his confident certainty is massively undercut by the way in which the play shows the death and punishment of both the wicked and the good characters. The ultimate image of this, which is perhaps the most desparate and bleak image out of Shakespeare as a whole, is that of Lear cradling the dead Cordelia in his arms. The massive uncertainty that the ending of the play leads us with as to whether the forces of good or chaos win at the end of the day underscores the inherent frailty of mankind in a world where there appears to be very little justice.