Paul Allen states his version of the IBM selection of OS for their IBM PC in his autobiography, Idea Man.
see my comment at https://news.ycombinator.com/item?id=43591941 for the long version.
Hopefully short version.
IBM went to Microsoft (MS) for languages for the new PC. IBM asked if MS could provide an OS. As per unwritten agreement, MS told IBM to go to Digital Research (DRI) for an OS.
Whatever happened at DRI, IBM didn't get a licensing deal for an OS. No OS meant no need for MS languages. When IBM complained to MS about not getting a licensing agreement for CP/M for IBM PC, one of the MS people suggested Tim Patterson's CP/M clone. IBM was outsourcing everything to keep away the IBM bureaucracy, so they told MS to handle everything.
When MS asked IBM how they wanted to pay for the OS, MS gave several options including 1) per copy royalty, or 2) flat rate (which turned out to be $40K). For easy accounting, IBM chose 2). MS asked to be able to license OS to others. IBM said yes. MS didn't really care about how IBM paid for the OS, their bread and butter was languages. DRI wanted to be paid per copy of CP/M-86.
DRI still didn't have a retail CP/M-86 for IBM PC at launch time. By the time they did ship CP/M-86, charging much more than PC-DOS1.0, Lotus 123 would launch within a few months running on PC-DOS. By the time DRI lowered the price for CP/M-86, they were way behind in market share.