International Business Machines Corp., making the biggest acquisition in its history, agreed to acquire Cognos Inc. for $5 billion, in another sign of the increasing importance of software to Big Blue's future.

The move represents a shift in IBM's acquisitions strategy. For the past 10 years, it has avoided buying applications-software companies such as Cognos, in an effort to maintain partnerships with vendors that might be rivals in the same applications niche. But recent events may have forced its hand, as major Cognos...