Corporate finance is one of the more important and less-visible parts of finance.

Perhaps because many of us save and invest for the future, and perhaps because almost all of us use debt to buy things, the retail banking and investment banking industries get a lot of attention. But much of what both retail and investment banks do are more for corporate clients than individuals, or even individuals grouped together in an investment vehicle like an index fund or a hedge fund. In fact, much of the financial industry involves managing corporations.

Corporations use banks and other financial services for a variety of purposes, but one that I’d like to focus on today is the use of commodity, currency, and derivative trading.

The classic example of how derivative trading exists within a corporation would be as a hedge against known needs. For instance, American Airlines (AAL) knows how much fuel it will need to buy in, say, the next six months. That cost is tied to the cost of oil. If oil is very cheap, AAL knows their variable costs will be lower for a while. However, if the cost of oil suddenly rises, then all of a sudden their variable costs will spike.

They can hedge this exposure to oil, which is an unavoidable result of their business operations, by going long oil before they need to buy jet fuel. Since their future need to buy fuel means they are effectively short oil for a fixed period, they can offset that short position with a long position in oil.

To take that position, however, they need to use banks. AAL is too big to just buy oil futures from one buyer at the CBOE! This is a classic example of corporate finance.

And sometimes, this rather utilitarian use of corporate finance to hedge risk and keep balance sheets smooth can produce wild and unusual results. Since, after all, derivatives can have extremely dramatic price movements in short periods of anomalous market moves, it’s possible for companies to make a lot of money from these normal business operations in a very short period of time.

One of the best such examples may be the $13.5 billion pre-tax profit that Porsche earned in 2008—a year of tremendous disasters for most investors. Over 85% of that profit came solely in call options on Volkswagen, which it was about to purchase thanks to those options.

But, as with any derivatives trade, there were risks. When the market collapsed in late 2008, Porsche’s debt load swelled relative to earnings due to a collapse in car purchases, and banks were suddenly not lending to anyone. Suddenly the highly profitable carmaker, which had used debt to buy those options in Volkswagen, was now facing a very sudden and unexpected bankruptcy. And then, in an ironic move, the cash-rich Volkswagen (thanks in part to Porsche’s bidding up of Volkswagen shares) was able to lend Porsche $4.4 billion—with the catch that Porsche would sell itself to Volkswagen.

Due to financial engineering, bad market timing, and shrewd opportunism in the boardroom, a dramatic hostile takeover became an even more dramatic reverse hostile takeover, and Volkswagen eventually became the parent company.

One of the biggest mistakes that made this all possible, however, was poor financial management and aggressive risk taking at Porsche. Ironically, 2008 was a very good year for hedge funds. Despite their public reputation as being high-risk funds, the hedging intrinsic to their methodology meant they outperformed the market in 2008, and quite a few made a lot of money. This was thanks to prudent and diligent financial analysis. Porsche, on the other hand, used financial derivatives in a daring and high-risk maneuver that, like so many high-risk efforts, backfired badly. Had they more risk management officers, like hedge funds do, perhaps the story would’ve ended quite differently.