Microsoft and IBM started the development of OS/2 because IBM wouldn't support Unix. (Microsoft had the most widely used Unix of the day, in Xenix.) IBM required a proprietary OS and had a long-running war with AT&T.
Microsoft backed OS/2 strongly but sales were, in Bill Gates's word, "dismal". It was a flop. However, Windows was a hit.
Microsoft wanted to go to a 32-bit OS/2 v3, which is what became Windows NT.
IBM had sold tons of 16-bit IBM PC/AT machines and insisted on a 16-bit operating system.
Hence the divorce, where Microsoft kept Windows and got a bundle of cash ($25 million, if I remember correctly). IBM got OS/2 and an ultra-sweet deal on Windows ($9 a copy, if memory serves).