Files are the building blocks of the UNIX operating system. There are different types of files like regular files, directories, FIFO files, character device files, and block device files. The UNIX kernel uses files, file descriptors, a file table, and an inode table to manage file input/output operations when a user executes a command. This allows processes to open, read, write, and close files.