You almost had to feel sorry for Kirk Shireman on Friday night. The affable, able manager of the International Space Station sat next to Elon Musk during a news conference after a Falcon 9 rocket had just delivered a cargo-supply ship to orbit and then made a stunning landing back on a robotic barge. For most of an hour he waited, patient and silent. Only at the very end of the briefing did a single, solitary question come Shireman's way.

A three-decade veteran of NASA who played pivotal roles in both the shuttle and space station programs, Shireman might have been thinking this: Hey, what about us? NASA is the one with the $100-billion orbiting laboratory where humans have now lived in space for 15 years. While no one anticipated it when NASA and Russia began building the space station 20 years ago, one of its most important functions has become enabling commercial activity in space. With the station, NASA created a market for companies like SpaceX to deliver supplies and, as early as next year, astronauts into space.

Friday afternoon's launch offered a spectacular display of this commercial aspect. As its largest payload, the SpaceX Dragon delivered Bigelow Aerospace's expandable habitat to the station. By connecting this inflatable room to the station later this month, Bigelow can gain invaluable testing experience, including in situ monitoring by astronauts next door. They may also prove to NASA that the technology is safe and perhaps lead to larger habitats for use near the Moon or deeper into space.

Nevertheless, Musk got all of the glory Friday night, and understandably so. He built SpaceX from the ground up, surviving three launch failures that almost killed the company and endless scorn from much larger competitors who never believed this weird guy from South Africa could threaten their billion-dollar businesses. Today, Musk stands at the vanguard of the new space movement that seeks to radically rewrite the economics of spaceflight as the old-guard competitors tremble.

NASA, by comparison to the nimble SpaceX, is a lumbering government agency bloated by decades of parochial Congressional meddling. It doesn't need ten field centers, but it has them to keep senators and representatives placated. NASA nonetheless remains very much a greater good and recognizes the importance of new ideas even if Congress often does not. It has therefore remained a steady partner to SpaceX, and, in fact, has been something of a guardian angel to the company.

In his excellent book Elon Musk, author Ashlee Vance recounts the most dramatic of NASA's saves. From 2006 to 2008, SpaceX endured three failed launches of the Falcon 1 rocket. The fourth, in September 2008, finally succeeded. Still, the company appeared poised to go bankrupt as it struggled to meet payroll in late 2008. Even as its cash ran out, SpaceX was in the midst of capital-intensive transition from the single-engine Falcon 1 rocket to the much more complex Falcon 9 rocket. Moreover, to earn business from NASA to supply the ISS, it would also need to build a delivery capsule.

That fall and early winter marked the darkest hours for the cash-strapped Musk, as both SpaceX and Tesla spent hundreds of millions of dollars on development, with little revenue to show for it. "I could either pick SpaceX or Tesla or split the money I had left between them," Musk told Vance in the book. "That was a tough decision. If I split the money, maybe both of them would die. If I gave the money to just one company, the probability of it surviving was greater, but then it would mean certain death for the other company." The economy worsened that fall, and by December, Musk's money had run out and he'd tapped all the loans he could.

Then, two days before Christmas of 2008, NASA announced it was awarding commercial cargo contracts to Orbital Sciences for 19 flights and SpaceX for 12 flights. The contract was valued at $1.6 billion for SpaceX.

Musk has famously spoken of his tears upon learning this news. He was dating the English actress Talulah Riley at the time, and he hadn't bought her anything for Christmas. "I went running down the fucking street in Boulder, and the only place that was open sold these shitty trinkets, and they were about to close. The best thing I could find were these plastic monkeys with coconuts—those 'see no evil, hear no evil' monkeys."

That contract allowed SpaceX to finish the Falcon 9 rocket and build the Dragon spacecraft. The Falcon 9 has become the company's workhorse rocket, which offers launches at a steep discount to competitors. With the cargo contract, SpaceX also positioned itself to win a lucrative $2.6 billion contract from NASA to deliver crews to the ISS beginning as early as next year. During most of his tenure as NASA administrator, Charles Bolden has been a steady ally, continually advocating for more commercial cargo and crew funding for private companies.

It's not clear how long this happy relationship between SpaceX and NASA will last. The company may fly its Falcon Heavy rocket late this year or in 2017, and although it doesn't have quite the payload capacity that NASA's under-development Space Launch System does, it will cost far less to fly. The next president, or some in Congress, may begin asking why NASA is spending billions to develop its own heavy-lift rocket when SpaceX already has one.

But on Friday night it was all good. Across NASA's field centers, in cubicles, offices, and coffee rooms, the engineers working on various projects were watching. As one young flight controller from Johnson Space Center told me about her experience, "There were about 20 people crowded around my screen, and we were all going nuts." Elon Musk hasn't forgotten NASA, either. The first thing he did during Friday's news conference was to thank the space agency that had made it all possible.