There's a little more to it than just M$ hooking up with IBM, it involves decisions made by Apple, IBM, and many others.
Back in the late '70's IBM noticed the emergence of the standalone computer, like the Apple II, Commodore, etc, etc. and it's growing popularity in the business world. Management told them to develop a similar machine for sale to businesses, low priced. IBM never saw the PC as being a meaningful competitor to their big iron and terminals. LOL!!! How history repeats itself.
With the very first one they had 3 DOS's available, DR-DOS, PC-DOS (M$), and CP/M. Don't remember the details but IBM ended up going exclusive with M$ shortly after. Not long after hardware clones started popping up in the market place. IBM made a decision to not go after any of them for Copyright infringement even though they had reverse engineered/copied the BIOS. This was a critical decision as it allowed hardware prices to drop very quickly. Some, like Compaq, used a clean room technique to document that their BIOS was completely original. At the same time the agreement that IBM had with M$ also allowed M$ to market to anyone else.
Parallel to this Apple also had others who were trying to copy their products. Unlike IBM, they went after the imitators with all they could afford. Hard to say whether this was a result of the personalities involved or basic business decisions - does a company allow other companies to copy the products that are it's life blood. Years later Apple did license their hardware and software to others but it was too little, way too late.