More than a century after its founding, IBM has become a major player in the AI revolution. Here's how it happened.