Thrashing occurs when the operating system spends excessive time swapping data between virtual memory (disk) and RAM, leaving little time for actual program execution. This happens when running too many programs or programs requiring more memory than physically available. It causes severe performance degradation as the system constantly reads/writes to disk instead of processing.