Northrop Grumman (NOC -1.56%) will not compete to build the Air Force's next-generation fighter jet, setting up a dogfight between Lockheed Martin (LMT -0.75%) and Boeing (BA 0.25%) for what could end up being a multidecade, nine-figure contract for the winner.

The decision by Northrop, announced by CEO Kathy Warden on the company's second-quarter earnings call, was a surprise, though the company could still end up profiting from the new jet. The Next Generation Air Dominance (NGAD) fighter will succeed Lockheed's F-22, a program that cost the government nearly $70 billion in new plane sales and significantly more in upkeep and servicing.

Here's a look at the opportunity in front of Lockheed and Boeing and a breakdown of each company's chances.

Lockheed has been on a roll

Lockheed comes into this competition on a winning streak but with some ruffled tail feathers. The company emerged victorious in both the early 1990s competition for what became the F-22 and the subsequent F-35 Joint Strike Fighter aircraft Bake-Off, besting Boeing both times.

It is an impressive winning streak that has funneled billions in government research and development funds into Lockheed's aviation arm, giving it an advantage in future competitions. The F-22 and then the F-35 have accounted for a significant share of Lockheed's revenue over the past two decades, providing cash flow the company has used for acquisitions and returns to shareholders.

But neither program has been exemplary. The F-22 was outdated by the time of its arrival, an engineering marvel but an analog plane unfit for a newly digital world. The F-35, in contrast, came with cutting-edge electronics and the ability to upgrade as technology evolves, but it has faced repeated delays and issues implementing some of its most advanced features.

Lockheed comes into the competition with both the experience of those successes and some baggage stemming from the issues with those planes.

Is this the reboot Boeing needs?

If the Air Force is looking for a fresh start, it will find a kindred spirit in Boeing. For all the problems Boeing has dealt with on the commercial side, its defense business has been just as troubled.

The last vestige of Boeing's once-proud fighter legacy is the F/A-18 Super Hornet, a design that first flew nearly three decades ago and is now at risk of being phased out by the U.S. Navy. The company's defense and space business posted a loss of more than $500 million in the most recent quarter, hemorrhaging money on programs that include NASA's Starliner and the T-7/A new trainer aircraft, among others.

One of its highest-profile aircraft wins in recent memory, the KC-46 fueling tanker came in years late and billions over budget and had to be grounded soon after initial deliveries.

The Pentagon is eager to preserve competition among contractors and would likely wish to spread the wealth beyond Lockheed Martin. Northrop's decision to bow out positions Boeing as the only viable alternative. But it could be difficult for a company trying to rebuild its reputation in Washington to convince the Air Force to trust it with one of its most important programs.

Northrop is wise to stay focused

For Northrop Grumman, the deferral comes from a position of strength. In 2015, the company beat a joint proposal by Boeing and Lockheed to win the B-21 bomber competition, a program expected to be worth $80 billion. Northrop is devoting significant resources to keeping that program on track, leading CEO Warden to choose to remain "disciplined in assessing the right programs to pursue."

Northrop has other ways to win here. The company is a major subcontractor to other fighter programs, doing the fuselage work for Boeing's F-18 and serving as one of the top contributors to Lockheed's F-35.

The company is set up well to profit as a subcontractor to the eventual winner while focusing its resources on important franchises like the B-21 and nascent technology, including uncrewed planes.

And the winner is...

It is important to note we are at the very early stages of a multiyear competition, so there are a lot of opportunities for predictions to age poorly. That said, this feels like Lockheed Martin's fight to lose.

The Air Force, in awarding the B-21, showed a preference for continuity, picking a modernized version of Northrop's B-2 over a clean-sheet replacement. The F-22's brawn is unrivaled, and the most obvious choice for a successor would be an updated version of that aircraft, with the brains and technical wizardry of the F-35.

Investors should not over- or understate the magnitude of this competition. Given this program will play out over years, there will be no immediate revenue boost to the winner and will unlikely be a massive stock pop. There is no short-term, get-rich-quick "play" for investors to take advantage of.

But the attractiveness of defense stocks lies in their steady, predictable revenue streams and balance of growth and ability to return capital to shareholders through dividends and buybacks. Programs like NGAD are the foundation on which strong defense contractors are built.

This competition is an opportunity for either Lockheed or Boeing to solidify that foundation for future generations.