One of the most important jobs an operating system must handle is acting as a go-between for your computer's hardware and software. If you were to crack open your computer, you'd find various circuits, chips, wires and other components. This physical layer of hardware is what does the actual work when you run a program. But a program has to have some way to access these physical components to run.
The operating software acts like a platform for programs. An OS makes sure that the processes running on a computer have access to the appropriate resources. The OS also allows hardware and software to communicate to each other. This includes input/output (I/O) devices.
That's a big job -- there are hundreds of different I/O devices you could potentially hook up to a computer. Take the computer mouse -- there are dozens of manufacturers producing various models of mice. It would be impossible for a software developer to build in native support for every type of mouse on the market. Instead, the operating system handles the differences between various pieces of hardware using special software called drivers. To us, it seems like every computer mouse just works.