After computers became more used, it was recognised that there was some common and basic functionality they would need to run. Engineers used to program every simple function in, including the most basic start up and hardware access, in machine code.
Early OS's were sometimes simply a BASIC interpreter or a set of kernel routines designed to simplify hardware access. These had no real user interface to speak of, and were still programmed by flicking switches, or later by punched card stacks. Early experiments got these to transmit sounds and pictures, a function which became usual, and was eventually embedded in the OS along with the keyboard and systems to actually store programs - with early computers you actually had to key in a whole program to run it again!
As computer usage grew further, more and more operations were relegated to the OS to the extent that we now have the entire Network Stack handled by it.
Modern OS's are distributed with a full GUI, Internet Browsers (like Firefox), mail readers, music and video players, basic text editors and so on. When you are programming a system, the OS provides the basic layer upon which you build (base SDK/API's and Libraries) - your software foundation if you like, and it is worth being very aware of it and its capabilities/limitations as well as any alternatives if you are setting out on an advanced project.
On the modern desktop Microsoft Windows and Linux are probably the two most well known examples of OS's along with the likes of Suns Solaris and Apples OS X.
On the Pocket PC the name actually describes the OS, although there are Linux distributions like the Familiar project which runs on many IPAQ's and Axims.
Time to build your own robot! Using a Raspberry Pi with parts and some time, you can use my book to learn how to make and program a robot with automatic behaviours.