Buffer overflow can lead to a segmentation fault due to the violation of memory safety. When more data is written into a buffer than it can handle, an overflow occurs. This excess data then overwrites adjacent memory locations causing unexpected behavior in the program. If this overwritten memory includes important data like function return addresses or pointers, it could cause the program to execute unintended instructions or access forbidden memory areas. The operating system detects these illegal operations and responds by killing the process, resulting in a segmentation fault.