To better understand how the software industry works it's important to get a clear idea of the origins and the strategies of each operating system and how history unfolded to make things the way they are today.
The early days
At the beginning, computer researches were funded by governments and developed as science projects mainly by universities and the army. At these early days, computers were expensive, very big and only usable by experts. This was the innocent era of computer history, when developers were a small community that worked together to make computers do specific tasks with no influence from companies or the public (= large amounts of money). The system they used was mainly UNIX, developed by AT&T home appliance at Bell labs in 1969. The hardware was a collection of components assembled in very large rooms, each lab with their own specific and crafted mix of hardware. They were experimenting and building knowledge on this new and promising field.
It didn't took very long until young and talented people got involved and started their own experiments. In the mid 70's, Steve Wozniak, a genius geek, and Steve Jobs, a genius salesman teamed up to start the first company that would sell this hot technology to the average Joe. Together they created a market for a product that was unknown at that time: the Apple computer. They built the hardware and software of these personal computers, inspired by UNIX, to produce a reliable, powerful and user friendly computer. The strategy was to make a product that would find its place into every home and look pretty much like any other home appliance, beautiful, simple and useful. This strategy is at the core of Apple's success until now: more power under the hood, less buttons on the surface.
Soon after, hardware companies that manufactured computer parts (IBM) decided to build these personal computers on their own. They had full control of the hardware industry but were desperately in need of a user friendly operating system. The folks at Apple had no interest in selling their operating system because they wanted to build everything themselves, the software and the hardware into one product.
That's where Bill Gates, Paul Allen and Steve Ballmer come into play. They decided to provide the software that would go into all the hardware in need of an operating system. In order to do business with hardware vendors they had to provide them with an operating system that would work on these machines. Since they had very little time to come up with a solution, they bought in 1980 the "QDOS" (Quick and Dirty Operating System) and transformed it into DOS (Disk Operating System) to deliver on time the software that IBM needed for their hardware. Microsoft succeeded in finding a good business model (install their software into every piece of hardware they could put their hands on) but suffered, from the very beginning, of a technical weakness that has haunted their operating system since then (like viruses for example). The strategy was to make their software the only one around by implementing it on computers from factory.
GNU/Linux and the Free Software Movement
In the early 80's, Richard Stallman, a computer programmer working at MIT realized that all the software produced at that time was proprietary (owned by companies that would keep its code secret). Being a computer programmer working and tweaking with UNIX all day, he did not accept the fact that he had no access to the source code that was being produced by these companies. Without the code he had no way of knowing exactly what the program actually did. Unsatisfied with this situation he launched in 1983 the GNU project.
The idea was to create a free operating system, based on UNIX, with the help of whoever would want to join and participate. As it turns out, people did join him and together, this community created probably the greatest cooperative work mankind has seen to date. Not only they produced software but they also established a philosophical approach to programming, the Free Software Movement, to defend the freedom of computer users.
The only essential piece of software that GNU was not able to produce efficiently was the kernel. The kernel is the basis of the operating system, used to allocate hardware resources to every software running on the computer. The reasons for that is that the GNU kernel (called Hurd) was a far too ambitious project. It eventually got operational in 2001 but the world could not wait that long. Ten years before that, in 1991, Linus Torvalds, like many others, a student, managed to write a kernel called Linux, and released it to the public. People immediately realized that, together, GNU & Linux could be used to make the first ever entirely Free and Open Source operating system.
Where we are today
About 90% of domestic computers still run Windows although we are already seeing it's market share slowly eroding. Almost all hardware vendors (with some very few exceptions like Apple Inc.) sell their computers with Windows pre-installed. These companies are legally tied to Microsoft and sometimes they just cannot sell another software. We are even seeing today attempts to make it impossible (or very hard) to uninstall Windows (e.g. secure boot).
Mac Computers are about 7-8% of the market share and their computers are also only sold with Mac OS. Apple goes even further by making their software only installable in Apple hardware.
GNU/Linux is running in only 1-2% of consumers desktops (this is already several million computers) but had an astounding success with Internet servers and super computers (it powers about 70% percent of servers and maybe 90% of super computers).
In the end...
Microsoft is still the leader in the desktop market but they are also taking other markets like video games and services. Apple took the lead in the mobile industry with the iPod, iPhone and iPad success. GNU/Linux and FOSS are thriving in mainframes but also on small embedded devices.
Technology is evolving fast and new challenges are arising everyday. We are seeing more and more mobile devices, wearable technology and cloud computing but we still don't know where this will take us.