Here's Why Captain America Could Lift Mjolnir in Avengers: Endgame
While Steve Rogers wielding the legendary hammer in the final battle was a cool scene, no one really understood why it was possible for him to do that at all.
From everything we know about Mjolnir, its powers do not exclusively belong to Thor. While he's the one who normally wields the hammer, Mjolnir can be lifted and even used by others, too… If they are "worthy" of it.
The thing is, we never got a proper explanation of what "worthy" means in this context and how the hammer defines it.
In Age of Ultron, Steve Rogers aka Captain America managed to slightly shift Mjolnir when he tried to lift it; in Endgame, however, he was able to pick the hammer up and use it against Thanos.
So, the question is as follows: what changed so significantly between these two movies that Steve Rogers suddenly became worthy of Mjolnir?
The answer to this question can be found in Thor #15, where the God of Thunder loses the ability to wield Mjolnir after becoming the new King of Asgard.
Concerned about this change, Thor comes to Captain America to share his problem, and finally explains what exactly being worthy of Mjolnir means.
According to Thor, Mjolnir only serves someone who can be called "the tip of Asgard's spear," someone fighting on "the front lines of any given threat to the worlds entangled in the roots and branches of the world tree."
As Thor ascended to the throne, he became a ruler rather than a warrior, so he lost the hammer.
This very same logic applied to Captain America, too.
In Age of Ultron, he was merely one of the warriors fighting against the common threat — but in Endgame, Steve Rogers was the last man standing against Thanos and he led the charge once the reinforcements arrived, so he virtually became "the tip of Asgard's spear" then.
In the non-existent eyes of Mjolnir, this made Captain America worthy of wielding the God of Thunder's hammer.
Much like wands in Harry Potter, Mjolnir picked its warrior, but he didn't need a soulmate — it wanted the best of the best, someone fighting on the frontlines of the world's biggest wars. This is what "worthy" meant.
Source: Thor #15