Although the Marvel Cinematic Universe has occasionally been accused of weakening its characters, Thanos proved just how powerful he is in Avengers :Endgame by doing the seemingly impossible: breaking Captain America's shield.
Composed of fictional vibranium, the shield was believed to be able to absorb blows from anything and anyone. However, it shattered in the film's finale as Steve Rogers took on the Mad Titan. But by the finale, an aged Captain America returned after traveling back through time, to pass on a fully intact shield to Sam Wilson. That leaves two major questions: How was Thanos able to shatter the virtually indestructible shield, and how was Captain America able to repair, or replace, it?
Co-director Joe Russo recently addressed the first question, casting doubt as to whether vibranium is the most powerful metal in the MCU. Clearly Thanos is a thousand-year-old character who has fought everyone in the universe and is the greatest: He's the Genghis Khan of the universe, so he would have the greatest weapon," he told ComicBook.com. "He knows of Eitri, he's been to Eitri to have his glove created. Did he have them create his blade as well? Potentially. But it's interesting that it could destroy the shield."
Given that Eitri forged the Infinity Gauntlet and Thor's ax Stormbreaker, surely he would be able to create a weapon capable of damaging the vibranium shield. The substance is alien in nature, so surely both Eitri and Thanos would know of its resilience, and prepare accordingly.
There's also Thanos' own strength. Only extremely powerful beings able to survive using the Infinity Gauntlet, and even then, there's a price. That's reflected in the extensive damage to both Thanos and Hulk. A weapon forged by Eitri, combined with the raw power of Thanos, would potentially have the capability of overcoming even vibranium's defenses.
Agent of Shield
That still doesn't explain how Captain America has a perfectly good shield to give to Sam Wilson at the conclusion of Endgame. This shield shows no wear and tear or damage, making it obvious it isn't the original, somehow re-forged. It could be one that Captain America acquired from an earlier era as he returned the Infinity Stones to their proper places in time.
There is the possibility the Wakandans made another shield for Captain America, as they control Earth's supply of vibranium. They provide him with a very different shield during the final battle of Infinity War, but given their connections to Bucky Barnes, as well as the time gap between Infinity War and Endgame, it's possible they completed any spare shield.
However, it's also possible this is the one that Howard Stark had made for Captain America, and that he simply kept it with him when he stayed in the past to live life with Peggy Carter. That's probably the strongest theory, although it does raise the question of why that copy of the shield would be where it is in Iron Man 2. There's also the chance there are replica shields that people didn't know about, and Cap simply took advantage of that to replace the broken one.
Unfortunately for now, the writers and directors have left it fairly ambiguous. This may be a plot hole or editorial oversight, or, given Marvel's heretofore meticulous planning, a plot thread for future movies. More than likely, it's a subject that will be covered in the upcoming The Falcon and Winter Soldier Disney+ series, a surefire way to get continuity sticklers to watch.