By Kevin Kelleher, contributor
FORTUNE -- On the face of it, Hewlett-Packard and IBM have a lot in common. Both are storied brands with rich legacies that shaped high-tech. Both are working with companies large and small to help manage their technology. Both are angling for a piece of the markets -- like cloud computing and big data -- that promise years of growth.
And both have new chief executive officers: Meg Whitman moved into HP's (hpq) CEO office a year ago; Virginia Rometty took the reins at IBM (ibm) in January. Both companies share a similar vision for success. And both face similar challenges to get there, like a sluggish global economy and the rise of disruptive new technologies.
Despite this bedrock sameness, HP and IBM are pushing forward on different paths. HP is in the midst of a multi-year turnaround, while IBM is building on a long-term plan outlined years ago. Neither company's path was charted in large part by its current leader. Why? First, their views on the role of hardware versus software in the future of IT; and second, their approach to mergers and acquisitions.
IBM's last decade has been marked by steady leadership pursuing a long-term course. To move forward from its recent history as a maker of big computers, the company famously pushed into IT-consulting services and software, taking a step away from hardware in 2004 by selling the PC division to Lenovo for $1.75 billion.
Like IBM, HP saw years ago that the future of big tech was not in selling big computers to companies, but in taking on the increasingly complex tasks of managing them and all the antecedent technologies. But unlike IBM, HP maintained that hardware would continue to play a key role in its tech outsourcing business -- a bet the company made when it spent $25 billion for Compaq in 2002.
After Compaq, HP continued to grow. It went from a company that made $57 billion in revenue in 2002 to one that made $127 billion last year. By contrast, IBM grew relatively slowly -- from $81 billion in revenue in 2002 to $107 billion last year.
Over the past decade, HP has trumped IBM in revenue growth through its aggressive acquisitions. Under Mark Hurd's tenure, between 2006 and 2010, HP spent big on tech brand names like EDS ($13.9 billion), 3Com ($2.7 billion), Palm ($1.2 billion) and 3Par ($2.4 billion). Under Hurd's ill-starred successor Léo Apotheker, HP spent $1.6 billion on ArcSight and $11 billion on Autonomy, two software companies.
IBM, by contrast, has made many mergers and acquisitions since spinning off its PC division, but only once in that tine has it spent more than $2 billion -- for business software maker Cognos for $5 billion in 2008. Instead, it's made a handful of billion dollar deals in that time span: Internet Security Systems ($1.6 billion), data analytics firm Netezza ($1.7 billion), Sterling Commerce ($1.4 billion), and others.
But there is another aspect to the story. Ever since Lewis Platt stepped down as HP's CEO in 1999, the company has gone through seven different leaders, including two interim CEOs. That's as many CEOs as IBM has seen since Thomas Watson, Jr., retired from IBM in 1971.
The pace of CEO turnover can be crucial: While IBM has had the luxury of laying out five-year plans, HP has shifted from hardware execs Fiorina and Hurd to software exec Apotheker to e-commerce veteran Whitman. And those transitions -- or lack thereof -- have had a big impact on the two companies' strategies.
In other words, HP's M&A moves in the past decade chronicle the strategy of a tech giant pushing into hardware and software alike, a clear bet on a future that would rely on both. IBM, by contrast, saw its future more in the zeros and ones of software than the physical machinery of hardware.
HP paid big for its bets on hardware, wagering it would win out in the end. IBM, meanwhile, made lots of smaller bets on software, which has proven to be a cheaper business to start-up than hardware. That doesn't mean IBM won't pay out for acquisitions: The company has indicated it will spend $20 billion on deals through 2015 -- more than it has spent in the last 10 years.
What it means is IBM believes its big investments will be in software companies that are only starting to show their stuff. HP, of course, will also be looking for good software investments, but it wants to counterbalance them against some of the hardware companies that it bought over the past several years. It's a debate between pure software versus a mix of software and hardware.
HP's bet is risky because the world of tech is more and more driven by software. Hardware is and will always be an important component of tech, but in many areas -- personal computers, servers, switches and routers -- software is driving efficiencies and innovation. Hardware, while ever improving, is increasingly seen as more of a commodity business that delivers low margins.
Software, of course, has long been a high-margin business. Even though HP, through its years of acquisitions, has seen its revenue grow faster than IBM's, it is IBM that has enjoyed the bigger profits. Last year, IBM's operating profit was 27% of its revenue, versus an 8% margin for HP.
That's where IBM and HP stand today. The bigger question for their new CEO's is, where will these companies go? Where can their leaders take them?
Rometty has indicated she will build on the strategies set down by her predecessors, although she is willing to put a bold stamp on the company if that's what it needs. Whitman has been frank about the challenges facing HP, yet willing to make tough calls on its future. Whitman resisted demands from investors to spin-off HP's PC business. And this week, she reiterated her desire to make the company a player in the growing market for smartphones.
There is room for both companies to thrive, whenever the global economy finally improves. IBM will tell companies it's got the consulting, infrastructure and software expertise they need to push into the brave new era of tech. HP will say it offers the same, but it has the soup-to-nuts solution -- from consultants to apps to PCs and smartphones -- that's even more comprehensive. Both will battle other giants in the space, like Oracle (orcl) and Dell (dell).
Will both thrive? The financial markets measure a discrepancy. IBM is up 13% so far this year. HP is down 29%. IBM has a market cap of $236 billion. HP is valued at $36 billion, or less than a sixth of its rival's value.
But before you consider any of those statistics, consider the single metric that many people believe says more about a tech giant's future than anything. IBM has spent $18 billion in research and development over the last three years, or 6.0% of its revenue in that period. HP has spent $9 billion in the same period, or 2.5% of its revenue. To plan for the future may mean spending less on high-ticket acquisitions and more on research and development. As both companies steer toward a brighter tomorrow, that strategy seems one well worth betting on.