The merger between two of Elon Musk’s corporate bets on futuristic tech—Tesla’s electric cars and Solar City’s solar electricity—has driven anxious musings about whether the combination is wise.

That’s especially true after Tesla warned investors of another production hiccup last week—only delivering 14,370 cars to customers instead of 17,000 in the second quarter of this year—as the automaker scrambles to meet an ambitious production expansion for its new mid-market vehicle.

It might be difficult to see the value of the Solar City purchase right now, but there is a logic to the deal, driven by a political loss.

To understand the the link-up, you need to be familiar with a policy called “net metering,” and why it matters so much to companies like Solar City, which finance the installation of solar panels onto homes to supplement or replace power from the utility company.

These home-size power plants are cost-effective in large part because most electrical utilities are required to buy excess power from the homeowner—”net metering”—typically during peak hours when the solar system is producing excess power and the home’s residents are at work or school. While the homeowner is still reliant on buying electricity from the grid at night, they may break even or profit from the arrangement, since power companies often pay them back at retail, not wholesale rates.

But this arrangement has a problem: Power companies are tightly regulated on a state level, and set their prices based on the costs of generating electricity and the number of customers. As home solar energy has become more popular in sunny states, utilities using net metering have seen less revenue than their calculations predict, and have warned that paying back solar homeowners could put their capital investments and bond payments in jeopardy, and lead to higher rates for all customers.

Conceivably, these higher rates could lead more homeowners to go solar, requiring even higher rates, and so on, into a proverbial death spiral. Home solar companies and renewable energy advocates scoff at this concern, saying it’s an attempt by utility companies to justify higher rates, and that it shows their reluctance to seek greener sources of energy.

But utilities are politically powerful, and the last thing their regulators want is to see them in financial distress, so solar companies have seen political defeats in many states. When Nevada cut net metering rates earlier this year, Solar City pulled out of the state altogether. In April, solar companies including Solar City made a deal with New York state utilities to effect a controlled transition away from net metering. The writing on the wall is clear: Solar City needs a new way to capture the excess power of its solar plants, or its customers will dry up.

One way to capture excess power? Batteries that store the extra power within the home for use later. And Tesla is in the middle of building an enormous factory to produce arguably the most advanced batteries in the world. Indeed, in May Musk touted the possibility of Solar City using Tesla batteries in home solar during an earnings call, previewing the merger offer made just weeks later.

If Tesla City can reduce the cost of making a house-powering battery to just $640—some analysts believe it’s possible—then every Solar City installation can be both a power plant and a storage system. And if the battery pack is key to the economics and not just a bonus, why not bring the companies together in more than a partnership?

The combined company will still be a gamble, but not on the economics of solar power or the availability of future subsidies. Now, both Tesla and Solar City depend on the company’s ability to stand up its battery gigafactory and meet its production goals. Who says Elon Musk can’t focus?