One hundred and thirty nine seconds is all it took for an unmanned rocket to explode after blastoff and turn Elon Musk’s booming Space Exploration Technologies Corp. into a geyser of red ink.

That June 2015 disaster, followed by months of launch delays, contributed to a quarter-billion dollar annual loss and a 6% drop in revenue, after several years of surging sales and small profits.

Internal financial documents reviewed by The Wall Street Journal and interviews with former SpaceX employees depict robust growth in new rocket-launch contracts and a thin bottom line that is vulnerable when things go awry. They also show the company putting steep revenue expectations on a nascent satellite-internet business it hopes will eventually dwarf the rocket division and help finance its goal of manned missions to Mars.

A second explosion during testing on the launchpad in September grounded SpaceX again, adding to losses and causing a four-month delay. Its next launch is planned for Saturday, when it will seek to regain momentum in the face of depressed revenue, jittery customers and a rising backlog of missions.

SpaceX, based in Hawthorne, Calif., transformed the aerospace industry with innovative rocket features and Silicon Valley-style software design principles mandated by Mr. Musk, its billionaire founder and chief executive. The 15-year-old company became the first American firm in years to compete for commercial launch contracts, and the first company to launch and return a spacecraft from orbit.