IBM CEO Ginni Rometty Andrew Harrer | Bloomberg | Getty Images

IBM just agreed to spend $34 billion on Red Hat, the largest software deal ever. It's by far IBM's biggest deal in its 107-year history and follows five straight years of declining revenue at the company. There's no guarantee such a big bet will pay off. Spending this much won't suddenly vault IBM past Amazon in the public cloud market or turn it into a trendy software growth story like Salesforce or Twilio. But for a company looking to stay relevant as the technology landscape rapidly evolves, buying Red Hat is a bold move, and there's logic to it. "This is as transformative as it gets for IBM," Jeffrey Kvaal, an analyst at Nomura Instinet, wrote in a report to clients on Monday. Here are some of the possible benefits of IBM's acquisition:

Financial boost

Red Hat is a fraction of the size of IBM, but it's growing much faster and generating cash in the process. While analysts project meager growth at IBM this year before contraction again in 2019, they see Red Hat growing at least 15 percent this fiscal year and next. IBM expects the combination to boost revenue growth by 2 percent and increase earnings per share, excluding certain items, two years after it closes. Part of the expansion should come from sales of Red Hat's products to IBM's bigger base of customers. IBM intends to put its products on Red Hat's software stack, CEO Ginni Rometty said on Monday's call with analysts.

Working across clouds

Red Hat's heritage is doing business around the Linux open-source operating system. IBM has a public cloud that competes with Amazon Web Services. But developers use Red Hat's Linux on many public clouds, including those run by Microsoft and Google. That multi-cloud approach should help IBM bring in revenue as more companies choose to go to public clouds that are more popular than its own. Rometty said that buying Red Hat will help the company become the leader in the hybrid cloud market, and Jim Whitehurst, Red Hat's CEO, said on the call that "this is about providing choice and making sure customers are not locked in."

Developers and consulting work

Rometty said buying Red Hat means getting more than 8 million software developers on board, potentially bringing them closer to IBM's other products. There's also the opportunity for more consulting work for IBM. Helping deploy Red Hat products like JBoss middleware and the OpenShift software for deploying applications in virtual containers could all fall within IBM's consulting and managed service operations, according to the Nomura report. "We've been building out our own services capability, but it is very small relative to what IBM can bring to the table," Whitehurst said.

Edge over other legacy vendors