Founded in 1993 by brothers Tom and David Gardner, The Motley Fool helps millions of people attain financial freedom through our website, podcasts, books, newspaper column, radio show, and premium investing services.

A house of cardsSunEdison tried to build a network of affiliates that would provide an endless supply of capital to fund acquisitions and buy assets from its core development business. Yieldcos TerraForm Power(NASDAQ:TERP) and TerraForm Global(NASDAQ:GLBL) were central to this strategy and newly created "warehouse vehicles" were to act as a pit stop for projects if yieldcos weren't yet ready to buy them.

The yieldco model was the epiphany behind the plan. If a yieldco's dividend yield was low enough, it could issue shares to buy new projects. When combined with debt, it would be easy to buy accretive assets (meaning they would be additive to earnings and dividends) on an ongoing basis. In theory, there was a nearly endless amount of capital available as long as yieldcos could buy projects accretively. Build a project, sell to a yieldco, acquire a company, drop assets down to the yieldco. Lather, rinse, repeat.

The plan is flawless -- unless yieldco stock prices fall, dividend yields go up, and you can no longer buy projects accretively. Then the entire house of cards falls apart.

Image source: SunEdison.

A sign of things to come The confusing financial network started to come to light when SunEdison announced the $2.4 billion acquisition of First Wind in 2014. The up-front cost was $1.9 billion with a $510 million earn-out over upcoming years, and SunEdison went to work using financial engineering to make the acquisition happen.

To pay for the business, TerraForm Power would buy the operating portfolio for $862 million, the seller would issue a $340 million note, and SunEdison would eventually get $400 million in short-term debt and sell $190 million of shares in SunEdisonSemiconductor to pay for the cash portion of the deal. There was even a $1.5 billion warehouse facility that could keep funding construction of new wind assets to keep the cash flow coming to SunEdison.

To buy a $2.4 billion company, SunEdison used zero of its own cash. It simply flipped $190 million of shares in an affiliate for the cash it needed and then financed the rest of the acquisition. At the time, banks and sellers were more than willing to offer $740 million of new debt, plus funding the $1.5 billion warehouse vehicle. Yieldcos would do the rest of the heavy lifting.

SunEdison was so confident that its borrowing costs would remain low and the financial market would remain open that it added VivintSolar, LatinAmericaPower, GlobeleqMesoamericaEnergy, and Invenergy to the acquisition spree in the year following First Wind. And if yieldco yields had remained low and borrowing costs had been attractive, the buying spree may have succeeded. But this is where we start to run into problems executing on the plan.

If you can't build projects, what can you do? I've focused so far on the financial engineering aspect of SunEdison's business plan. At the core of all of this, however, was the project development business. SunEdison has to build projects at competitive prices, on time, and on budget to be successful. The financial engineering I highlighted above just facilitates this core business, but SunEdison couldn't seem to get building projects right, either.

An investigation into the company's finances by independent directors revealed that management was "overly optimistic" and did "not respond appropriately when forecasted targets were not met," among other complaints.

The most damning example of poor execution on the core business was HawaiianElectricIndustries(NYSE:HE)canceling power purchase agreements for 148 MW of solar projects that SunEdison had repeatedly delayed. You can read the filing here, but the short story is that SunEdison again and again missed contracted deadlines and eventually the utility got fed up. A similar story is unfolding in India, where TerraForm Global has sued SunEdison over its failure to complete projects it acquired in 2015.

If you're the world's largest renewable energy developer and you can't build renewable projects on time and on budget, what can you do?

The straw that broke the camel's back How does all of this financial engineering, acquisitions, and project execution play into today's bankruptcy?

When your entire business is built on low dividend yield yieldcos and endless, low cost debt issuances, what you have is a house of cards. As soon as yieldco stocks start to fall, dividend yields rise, the market starts to lose confidence, and the business model collapses. You can see below that the yieldco collapse has been taking place for months.

The lack of confidence debt providers had showed its ugly head in January, when the company converted existing debt for new debt with an interest rate that had a variable rate of more than 11%. That's an astronomical level that no renewable energy company (and most non-renewable energy companies for that matter) could withstand.

With yields and borrowing rates in the double digits, there was no one left within the SunEdison network to buy projects. Management tried to transition to a third-party sales model, but it didn't have the funds to complete projects it was already building and buyers in today's market are few and far between.

SunEdison had backed itself into a corner and all investors could do is watch the house of cards came tumbling down. The company wasn't built on a solid competitive advantage and that finally came back to haunt investors.

That's a lesson every renewable energy investor should keep in mind. The industry still has a lot of growth ahead of it. But you can't build a renewable powerhouse by counting on the kindness of capital markets. SunEdison learned that the hard way.

Travis Hoium has no position in any stocks mentioned. The Motley Fool has no position in any of the stocks mentioned. Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.