To recall a few details from the MCU, Thor’s hammer was destroyed by the evil Hela (Cate Blanchett) in “Thor: Ragnarok.” It wouldn’t be until “Avengers: Infinity War” in 2018 that Thor would replace his hammer with an equally powerful axe weapon he called Stormbreaker. Thanks to some time travel rigmarole, however, the original hammer was restored in time for “Avengers: Endgame” in 2019. The restored hammer was then used by Captain America in the film’s climactic battle. What Captain America did to become “worthy” of using this weapon remains unstated. During the film’s epilogue, Captain America returns the original hammer to the past from whence it came.
When Captain America used the hammer, as stated above, he gained Thor’s lightning powers. This, however, contradicted a “Ragnarok” wherein it was stated explicitly — by Odin — that the lightning came from Thor’s body and not the hammer. Indeed, the “Ragnarok” soundtrack blared out Led Zeppelin’s “Immigrant Song” to highlight this fact. It all makes sense, given that Thor is the God of Thunder.
“Endgame” co-screenwriter Christopher Markus recalls debating the Captain/hammer scene with the other filmmakers, and they did recall the “Ragnarok” line in question. They simply chose to ignore it. Markus said:
“There was certainly a debate at one point because particularly in ‘Ragnarok,’ it establishes that Thor can summon the lightning without the hammer. I think Odin even says, ‘It was never the hammer.’ And yet Cap summons the lightning with the hammer. You get to those things and you’re like, ‘It’s too awesome not to do it! We’ll talk about it later.'”
Evidently, they never talked about it, and “awesome” was all they wanted. If thousands of screaming “Endgame” fans are to be trusted, Markus seemed to make the right call.