You are comparing market cap to GDP. You should compare revenue to GDP. Still not a perfect comparison, but much much better.
Apple's revenue: 380B. Iran sits at position 40 with 380B GDP in 2022.
still kind of crazy to think Iran and it's entire oil reserves that power idk how many households produce the same amount of revenue as 175k people
Similarly, African raw materials form the core of many computers and yet Africa is still poor - because the raw material itself isn't that useful.