It's the largest power plant of its kind. Built in the Moroccan desert, the $765 million Noor-Ouarzazate complex is set to power over a million homes.

Even a few years ago, a project of this scale in the North African desert would almost certainly have been an oil or gas power station. But the Noor-Ouarzazate complex runs on the power of the sun.

It is a sign of how far solar power has come that such large infrastructure projects are now being built. That the scheme was partly funded through a loan from the Word Bank also shows how solar is becoming mainstream.

What’s behind the growth in solar?

Of course, concern over the use of fossil fuels and global warming is a large part of solar’s current success. But the reason it is doing quite so well, quite so quickly really comes down to price.

The cost of power generated by solar has plummeted to the point where, in many parts of the world, it is now close to coal or gas generated electricity.

Source: Earth Policy Institute/Bloomberg

The more solar grows, the cheaper it becomes to manufacture solar panels, and the virtuous cycle continues.

But it's not just that solar is becoming cheaper – it's also that fossil fuel generation is becoming more expensive. That's because once a solar or wind project is built, the marginal cost of the electricity it produces is almost nothing, whereas coal and gas plants require more fuel for every new watt produced. Power companies will choose the free power whenever they can, which means less is required from the fossil fuel power stations and the marginal cost of their power rises.

It’s a self-reinforcing cycle. As more renewables are installed, coal and natural gas plants are used less. As coal and gas are used less, the cost of using them to generate electricity goes up. As the cost of coal and gas power rises, more renewables will be installed.

Source: Bloomberg

BNEF reports that in every major region of the world, the lifetime cost of new coal and gas projects rose considerably in the second half of 2015, while the cost of renewables continued to fall.

How can we solve the problem of storing solar energy?

One of the problems with solar power is, of course, that it’s only there during the daytime. This has been used as an argument for keeping fossil fuel generation for the "base load" generation needed 24 hours a day.

But even this is changing. The Noor-Ouarzazate complex is not a photovoltaic power plant. Instead it uses concentrated solar power (CSP), which holds vast potential due to its ability to provide reliable power even when the sun is not shining.

Hundreds of mirrors focus the sun’s energy to heat a fluid that is used to produce steam that drives turbines to generate electricity. The fluid can also be used to heat molten salts stored in large storage tanks on site. The salt stays hot enough to generate steam even after the sun has gone down.

It is such a promising technology that the International Energy Agency estimates that up to 11% of the world’s electricity generation in 2050 could come from CSP.

What about batteries?

Another major change is rapidly improving battery technology. Already households can buy battery packs for their solar panels, and the cost of these is expected to reduce significantly over the next few years.

Entrepreneur Elon Musk reckons that the entire world’s electricity demands could be met with around 2 billion large batteries.

What if it’s not very sunny?

It is easy to see why Morocco might look to solar to meet its energy needs. The same goes for many other hot and sunny parts of the world. But is solar really workable elsewhere?

For the answer to that, take a look at Germany. Hardly famous for its year-round sun, the northern European nation has nevertheless led the world in solar generation.

Germany has the capacity to generate over a third of its electricity from solar and in the summer of 2014 even managed to briefly generate over half of its power this way. Germany shows us that solar is not just a technology for the sun-drenched parts of the world.

Solar isn’t the only answer to the world’s energy needs, but it has much to offer. As the cost falls and the energy market is further disrupted, solar energy is set to play a huge part in meeting our global energy needs.