In a nutshell
Contiguous allocation gives each process one unbroken block of memory, so the OS must find a free gap — a hole — large enough to hold it. First fit takes the first hole that works, best fit the smallest that works, worst fit the largest. Over time free space scatters into gaps too small to use (external fragmentation), even when the total free space would be plenty; compaction slides blocks together to fix it.