Shares of Embraer (NYSE:ERJ) have been tossed about recently, as the company's plans to form a commercial aviation joint venture with Boeing (NYSE:BA) have spurred a series of lawsuits, court injunctions, and a potential government veto.

However, Boeing and Embraer agreed to terms for the joint venture last month, and the Brazilian government recently approved the proposed transaction. While additional lawsuits are likely and more regulatory approvals are needed, investors can now have greater confidence that Boeing and Embraer will eventually be able to consummate their commercial aviation joint venture.

What Boeing and Embraer plan to do

Embraer has found it increasingly difficult to compete against Airbus and Boeing in recent years, because of the massive economies of scale enjoyed the two aircraft manufacturing heavyweights enjoy. While Embraer specializes in smaller planes, its rivals have offered big discounts when necessary to persuade most airlines to stick with the larger jets they sell.

That said, Embraer has a family of recently redesigned commercial jets covering the 70- to 130-seat segment of the market. Boeing doesn't have any products in that size range, putting it at a disadvantage to Airbus, which now has the A220 family of jets for the 100- to 150-seat market.

Thus, joining forces could be a win-win for Boeing and Embraer. Boeing plans to pay $4.2 billion for an 80% stake in Embraer's commercial aviation business, which will be operated as a joint venture, with Embraer holding the remaining 20%.

An Embaer E190-E2 parked in front of a hangar

Boeing is on track to buy 80% of Embraer's commercial jet business. Image source: Embraer.

The two companies expect to achieve $150 million of annual cost synergies within three years, as Boeing capitalizes on its purchasing scale. In the long run, Boeing's powerful global sales force should drive increased order activity, enabling higher production rates.

The joint venture moves closer to being a reality

Earlier this month, Jair Bolsonaro, Brazil's new president, expressed doubts about whether the Boeing-Embraer joint venture was structured well. He seemed particularly concerned about a provision that would allow Embraer to sell its 20% stake to Boeing. That situation led to renewed concern about whether the Brazilian government might exercise its right to block the transaction.

However, Boeing and Embraer quickly addressed Bolsonaro's concerns. As a result, Brazil approved the joint venture arrangement last week. Shortly thereafter, Embraer's board of directors ratified its support for the deal.

The remaining steps include winning shareholder approval and regulatory clearance. Barring any unexpected surprises, Boeing and Embraer expect to complete the transaction later this year.

Important questions remain

It's been more than a year since Boeing and Embraer were first rumored to be considering some sort of business combination and six months since they signed their preliminary joint venture agreement. However, neither side has revealed the details of the purchase agreement yet.

Of the $4.2 billion in cash that will change hands, Embraer expects to net about $3 billion after taxes and transaction costs. But that figure could change if Boeing and Embraer are able to reduce their transaction-related expenses. Furthermore, the new joint venture will assume some of Embraer's debt, but Embraer hasn't specified how much.

These details are important for Embraer shareholders. The commercial aviation business has historically generated the bulk of the company's profit, and Boeing will own most of this business. However, Embraer's market cap is just $4.3 billion today, and it has a little more than $3 billion of cash and investments to offset its debt of $4 billion. Depending on the terms of the Boeing transaction, Embraer could potentially pay down all of its debt other than what is transferred to the new joint venture, while still leaving extra cash that could be returned to shareholders.

One newspaper report has suggested that Embraer may pay out $1.6 billion to $1.7 billion as a special dividend -- nearly $10 per share of its U.S.-listed American depositary receipts. That would be a big windfall for shareholders. But until the joint venture deal is completed and Embraer confirms how it plans to use the extra cash, it's too early to celebrate.

Adam Levine-Weinberg owns shares of Embraer. The Motley Fool recommends Embraer. The Motley Fool has a disclosure policy.