Deadlock occurs when multiple processes are blocked waiting for resources held by other processes in the set, resulting in no forward progress. There are four conditions required for deadlock: mutual exclusion, hold and wait, no preemption, and circular wait. Deadlock can be handled through prevention, avoidance, detection, and recovery. Prevention ensures one of the four conditions is never satisfied. Avoidance allows resource allocation if it does not lead to an unsafe state. Detection identifies when deadlock occurs. Recovery regains resources by terminating processes or preempting resources.