— ⁂ —
It's important to understand the magnitudes we're talking about: world marketed energy consumption, excluding food but including non-electric energy uses like shipping, is² about 19 terawatts (160 terawatt hours per year or 14000 Mtoe per year); total terrestrial insolation is roughly 130 000 terawatts (at 1000 W/m², at ground level) to 170 000 terawatts (at 1361 W/m², above the atmosphere); and the Ghawar supergiant oil field contained a bit over 100 billion barrels of oil before the humans started extracting it³. At the standard value of 37 MJ/ℓ, 100 billion barrels is almost 600 exajoules⁴ ⁵; if you burned it all in one year it would also produce 19 terawatts. Total world oil "production" is about 81 million barrels a day⁶, which works out to 5.5 terawatts, more than a quarter of world marketed energy consumption (although a significant minority of that oil is made into asphalt and plastics rather than burned).
So current world marketed energy consumption is a bit over 0.1% of total terrestrial insolation, and oil is only able to supply a small part (≈20%) of world marketed energy consumption. The solar resource, like the enhanced geothermal resource and the fusion-fuel resource of the oceans, is truly immense, dwarfing fossil fuel consumption.
Morocco, to take one of the listed countries as an example, is 710 000 km² of mostly cloudless desert¹. If solar plants there get a 30% capacity factor (typical for temperate deserts, maybe a bit low for Morocco) and use low-cost 16%-efficient solar panels, they'll produce 48 W/m² (on average around the clock), which is 48 MW/km²; the country as a whole could produce 34 terawatts, about double world marketed energy consumption.
— ⁂ —
Historically speaking, the humans have burned fossil fuels because their photovoltaic panel manufacturing was too inefficient; until the 1990s, it took more energy to produce a solar panel than it would produce during its design lifetime of 30 years. Now low-cost solar modules cost €0.18 per (peak) watt⁷, following a dramatic fall in crystalline silicon PV module prices from €2.17 per peak watt in May 2009⁰ to €0.19 in December 2018, representing dramatic improvements in efficiency of some 22% per year; since then, a price-fixing cartel then announced at Davos has prevented further improvements in efficiency from further lowering wholesale prices. Still, their cost is now comparable to the cost of the heat engines and electric generators needed to harness fossil fuels for purposes other than raw heat, exclusive of fuel and other operational expenses.
It's commonly commented that the sun doesn't shine at night, so solar power only works at night if you have transcontinental power transmission lines (not yet existing, probably HVDC, perhaps a strategic vulnerability similar to Twitter) or utility-scale energy storage. The need for storage can make solar energy roughly as expensive at night as fossil-fuel energy, but during the day it's considerably cheaper in areas with large solar resources. If transcontinental HVDC becomes a real thing, the countries mentioned could become bigger exporters of solar energy than they ever were of oil energy.
— ⁂ —
One more note about Morocco: Morocco has a lot of Arabs, but it also has a lot of Berbers¹; it seems sort of flamebaity to describe it as an "Arab state"!
—
⁰ https://web.archive.org/web/20100722072720/http://www.solars...
¹ https://en.wikipedia.org/wiki/Morocco
² https://en.wikipedia.org/wiki/World_energy_consumption
³ https://en.wikipedia.org/wiki/Ghawar
⁴ https://en.wikipedia.org/wiki/Barrel_%28unit%29#Oil_barrel
⁵ https://en.wikipedia.org/wiki/Energy_density
⁶ https://en.wikipedia.org/wiki/List_of_countries_by_oil_produ...