Rivian Automotive (RIVN -7.26%) received some surprising but welcome news last night. Even after the stock jumped by 8% yesterday, it soared by as much as another 37% Wednesday morning. A new investment and partnership has the stock flying.

While the stock pared some of this morning's gains, it remained higher by 22.7% as of 12:45 p.m. ET. That's because of the announcement that Volkswagen is investing up to $5 billion in Rivian over the next two years.

An investment to save the day 

There's a reason Rivian shares were lower by nearly 50% year to date heading into yesterday's trading: The company has been burning cash. It has gone through more than $4 billion of its cash hoard in the last year. On top of that, it doesn't expect to produce any more EVs in 2024 than it did last year.

The investment from Volkswagen comes at a critical time. It includes $1 billion up front in the form of a convertible bond. Another $2 billion will be in common stock split between 2025 and 2026, subject to certain milestones. The final $2 billion is related to a new joint venture (JV) intended to create "next-generation electrical architecture and best-in-class software technology," according to a joint press release.

Rivian poured through cash in the last year as it retooled its production lines to prepare for its next-generation R2 vehicle platform. Production is scheduled to begin on those lower-priced EVs next year, with deliveries starting in 2026. That makes the timing perfect for this new capital infusion.

What's next for Rivian?

Rivian's cash was also used to continue to develop its in-house battery and electrical technologies. Volkswagen's investment helps to validate those research and development (R&D) investments.

Rivian now should be able to launch its R2 vehicles without needing any further capital infusions. It also will have new funds to continue to develop leading EV technologies. That lowers the risk on an investment in Rivian, even after today's gains.