If you thought Tesla Motors (TSLA 12.06%) was building its $5 billion Gigafactory in Nevada to bring down the cost of batteries so it can make a high-volume, low-cost fully electric car, you would be right. But if you thought Tesla's Gigafactory was being built only to provide batteries for electric cars, you would be wrong. In fact, Tesla is additionally targeting an entirely different major market outside of electric cars with its Gigafactory.

What is this other market Tesla will be building batteries for? Energy storage.

Rendering of Tesla's planned Gigafactory. Source: Tesla Motors.

The energy storage market
This isn't going to be some tiny side business, according to Tesla CEO Elon Musk. Tesla management has mentioned on several occasions that as much as one-third of the Gigfactory's output will be intended for stationary storage.

In other words, 16.5 of the 50 gigawatt hours of pack output Tesla is targeting by 2020 in lithium-ion production is supposed to be for stationary storage. To put that in perspective, 16.5 gigawatt hours of annual pack output is more than four times that of the lithium-ion battery output needed to support Tesla's total planned production for calendar year 2014.

In a recent interview at the Offshore Northern Seas conference in Norway, Musk explained more specifically where he thinks this massive demand for stationary storage will be coming from.

"About a third of the output of the Gigafactory is intended as stationary storage, primarily to be paired with renewables, but also to do grid buffering in non-renewable situations," Musk said. "I think we'll see a really -- a fairly huge demand for stationary storage."

It's a bet on solar
Musk is particularly excited about the use of stationary storage for solar.

It's worth noting -- I'm not sure if people are aware of this -- but the world could be powered many times over by solar, if you had enough battery capacity to pair with it. Many times, like... a thousand. It's literally true. The amount of energy that reaches Earth from the sun is staggeringly high. We have this enormous fusion generator in the sky that is lobbing out a vast amount of energy. And I'm talking about just using land area. ... You could power the entire United States with about, say, 150 to 200 square kilometers of solar panels. Take a corner of Utah. And there's not much going on there. I've been there.

With these sort of possibilities for solar, paired with the current trajectory of technological and cost improvements in solar, Musk believes there will be big demand for stationary storage as demand for solar grows.

Of course, Musk is also the chairman of the board at SolarCity (SCTY.DL), a company that is also building a large factory -- but not for batteries. SolarCity's factory is purposed to bring the necessary economies of scale to solar to drive mass-market interest in lower-cost panels.

Image source: SolarCity.

"Our intent is to combine what we believe is fundamentally the best photovoltaic technology with massive economies of scale to achieve a breakthrough in the cost of solar power," Musk, along with SolarCity management, said in a press release earlier this year. The release announced a plan to build a solar panel manufacturing plant with a targeted capacity greater than 1 gigawatt of solar capacity within the next two years.

If solar does continue to gain traction, pairing panels with batteries would certainly make sense. Together, it would allow solar panels to convert power to energy that could be stored in the batteries for use at night.

. Indeed, SolarCity CEO Lyndon Rive said earlier this year that within five to 10 years, every set of panels the company installs will come with a battery pack.

Tesla's Gigafactory plans are undoubtedly huge and risky. But at least the company's target to serve two industries somewhat diminishes the risk if it were to only serve one market. Furthermore, if the public is underestimating either solar or electric cars, Tesla may not be very dependent on the other. And, in the best case, if the potential of both markets ends up exceeding expectations, Tesla will be at the center of a revolution.

Tesla's Gigafactory, which originally was supposed to begin producing batteries in 2017, is now ahead of schedule. The company said in its Q3 2014 letter to shareholders that it is now planning on cell production to begin in 2016.