In the early 80’s IBM was looking for a company to supply them with an Operating System for their 8086 IBM PC. They found their partner in Microsoft, which at that point only existed for 5 years and didn’t actually have an Operating System to sell.
Microsoft ended up buying the rights to 86-DOS and selling a modified copy of that to IBM. Microsoft would also include BASIC, a simple programming language, and a few example games written in it.
One of these games was written by the one and only Bill Gates.