The operating system acts as an intermediary between the user and computer hardware. It provides an environment for users to execute programs and increases productivity of computer resources. The main functions of an operating system include process management, memory management, device management, information management, secondary storage management, and network management. It allows for the creation and deletion of processes and files, allocates memory and devices to processes, and maps files to secondary storage.