Gates stole the window concept from Apple who paid Xerox for the right to poach employees from Xerox PARC. Xerox executives were giggling because they were shutting down the unit, firing staff, and throwing everything away, yet Apple was paying them for it.
When the Macintosh was a success Xerox tried another go at the Star.
Xerox Star was still a text-based machine. The display was formed with special text characters on a grid. IBM PC also shipped with a bunch of special text characters for drawing boxes, arrow pointer, etc. Macintosh had none of this. Every bit on the screen was a bit in memory set or cleared by the CPU. Text had to be drawn by the CPU but this meant there was no limit to the size, shape, or position on the screen. No video text generator. Apple Lisa had a text generator, but not the Mac.
IBM really wanted CP/M-86 from Digital Research, the owners of CP/M. But Gary Kildall and his negotiating team were incompetent, slow, and arrogant, so IBM took Bill Gates up on his offer for PC-DOS. Microsoft was already under contract to provide BASIC.