Buffer overflow occurs when a program writes more data to a buffer than allocated space, causing adjacent memory to be overwritten. The key is that it's about a specific variable's allocated memory being insufficient, not overall system or application memory.