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.
That oil is sold unprocessed and won't be powering anything unless it goes through a fairly expensive processing and logistics chain. Iran is also extremely inefficient and unproductive - it's a state after all.
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.
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