The software that manages a computer's hardware and provides services to every other program. It exists because writing each program to control the hardware directly is unworkable once a machine runs more than one thing.
Process management shares the processor between programs. A processor executes one instruction stream at a time per core, and the operating system switches between programs rapidly enough that they appear to run simultaneously.
Memory management gives each program the illusion of a large private address space. Virtual memory maps those addresses onto physical memory and onto disk, which allows programs to use more memory than physically exists and prevents one program from reading or corrupting another's.
File systems organise persistent storage into named files and directories, hiding the fact that storage is a numbered sequence of blocks.
Device drivers translate between a general interface and the specific requirements of particular hardware, which is why a program can write to a file without knowing what kind of disk is attached.
Access control determines which users and programs may do what, which is the foundation of every security property the system has.

Without an operating system, a program must know the specific hardware it runs on and must be rewritten for every different machine.
With one, a program requests services through a standard interface, and the operating system handles the hardware. The same program runs on different machines, and multiple programs coexist without knowing about one another.
The mechanism enforcing this is a hardware distinction between privileged and unprivileged execution. Ordinary programs run unprivileged and cannot access hardware or other programs' memory directly. To request a service they make a system call, which transfers control to the kernel running privileged.
That boundary is what makes isolation possible. A program cannot simply choose to ignore it, because the processor itself refuses the instruction.

The earliest machines ran one program at a time, loaded manually. Batch systems automated the sequence.
Multiprogramming allowed several programs in memory at once, so that when one waited for input the processor could run another, which mattered because input and output are enormously slower than computation.
Time-sharing extended this to interactive use by many users at once, which required responsive switching and access control.
Unix, developed at Bell Labs from 1969, was the most influential design. Its principles included treating almost everything as a file, providing small composable tools rather than large integrated ones, and writing the system in C rather than assembly, which made it portable between machines.
Portability was the decisive property. An operating system written in a high-level language could be moved to new hardware, and Unix and its descendants spread accordingly.

Unix-derived systems dominate. Linux, developed from 1991, runs the majority of servers, effectively all supercomputers, and forms the basis of Android. The BSD family underlies macOS and iOS.
Windows descends from a separate lineage and dominates desktop and laptop use in business and home settings.
Mobile operating systems added constraints the earlier designs did not need: power management as a first-class concern, permission systems for individual applications, and restriction of what installed software may do.
Virtualisation runs multiple complete operating systems on one machine, each believing it has the hardware to itself, which is the foundation of cloud computing. Containers achieve isolation more cheaply by sharing one kernel while separating everything above it.
Embedded and real-time systems, which run in vehicles, medical devices and industrial control, prioritise guaranteed response times over throughput, since a late answer is a wrong answer in those contexts.
Concurrency is the persistent source of error. Programs running simultaneously and sharing resources produce bugs that depend on timing, appear intermittently, and are extremely hard to reproduce.
Security follows from the isolation boundary, and the boundary is large. A kernel is a substantial body of code running with full privileges, and any defect in it is potentially a complete compromise of the machine.
Compatibility constrains design. Operating systems must run existing software, which means design decisions made decades ago persist, and the accumulated interfaces cannot be removed without breaking what depends on them.
The operating system is the reason software can be written without knowing what machine it will run on, which is what allowed a software industry separate from hardware manufacture to exist at all.
It is also the component whose success is measured by invisibility. A well-functioning operating system is one nobody thinks about, which is why the work it performs continuously is apparent mainly when it fails.