Historically, CONCACAF invited teams to improve the competition. In the past it invited pretty good teams from across the world to play in this tourny.
1996 Brazil
1998 Brazil
2000 Colombia, Peru, South Korea
2002 Ecuador, South Korea
2003 Brazil, Colombia
2005 South Africa, Colombia
It stopped in 2005 when CONCACAF started to get decent. Qatar is the first invite since 2005. They played in the 2021 tourny in addition to this year. I think they did it for two reasons. Qatar needs to compete against better competition and was willing to pay for it (indirectly). Qatar Airways is a major Gold Cup sponser.
Finally, I think various leagues do this across the world. I know Mexico has gone to the African tournaments as an invitee and I think the US went to South America years ago.