The answer to the "why" part of this question is the same thing that is impacting everything- COVID.
2021's summer international soccer schedule was very congested because events that were supposed to be in 2020 were shifted into 2021.
Planned summer calendar (men's):
2018- World Cup (June-July)
2019- Concacaf Gold Cup (June-July), UEFA Nation's League knockout rounds (June)
2020- Concacaf Nation's League knockout rounds (June), European Championship(June), Copa America(June), Olympics (July-Aug)
2021- Concacaf Gold Cup(June-July)
2022- World Cup (Nov-Dec)
There is normally no World Cup qualifiers in the summer since players need at least some breaks after the club season and June international duty. However, this is what ended up happening-
2018- World Cup (June-July)
2019- Concacaf Gold Cup (June-July), UEFA Nation's League knockout rounds (June)
2020-
2021- 2 US friendlies (May-June), Concacaf Nation's League knockout rounds (June), Concacaf Gold Cup(July-Aug), European Championship(June), Copa America(June), Olympics (July-Aug), Early rounds of Concacaf WC Qualifiers (June), 2 Conmebol WCQ rounds (June)
2022- World Cup (Nov-Dec)
The US decided to send a full strength team (aka mostly European based) to the Nation's League SF/Final since it was earlier in the summer. That way all the European based guys could have a full month of rest before their club preseason started in mid July. They played 4 games (2 friendlies and then the semis/finals) from May 30th-June 9th.
The US roster for the Gold Cup was almost exclusively MLS based players. Only 4/24 were European based, and all 4 of those players were young (24, 23, 20, 20). The entire squad was very young and inexperienced- the non goalkeeping average age was 23.5, and 13/24 players had less than 5 appearances for the national team. Had the US qualified for the men's Olympic tournament, the majority of that squad would have come from this group since it is a U23-ish tournament. When World Cup Qualifiers start in the fall, I would only expect at most 5 players from the Gold Cup squad to even really be considered (Zardes, Robinson, Cannon, Acosta, and Turner).
Mexico used 13 of the same players in both competitions, but their Nation's League team was definitely stronger. Mexico also had to send a U23-ish team to the olympics, so they couldn't really send a similar young, Mexico based squad to the Gold Cup since that is what their Olympic squad is.
If I had to rank the squads that played each other-
Nation's League Final: USA A v Mexico A
Gold Cup Final: USA B for Mexico B+/A-
Olympics: Mexico C+