There are also processes that are running. Processes are programs that programs run. Usually the only place you can see the processes is on the Processes tab of the Task Manager.
When you shut down your laptop, Windows goes through all of the programs and processes and tells them to close. If one of them does not respond to Windows, you get that message. Sometimes it happens when a process is slower in responding than Windows wants.