"Undefined behavior could format your hard drive" is kind of a meme, but it's a meme with a point. A lot of programmers have the idea that UB is "what the hardware does", that when you go outside the bounds of the C program you just have to think at the machine code level to figure out what will happen. But that's not the reality with a modern compiler; what with all the levels of analysis, optimization, and transformation that happen between source code and machine code, the effects of undefined behavior are extremely unpredictable and often inconsistent and nondeterministic. The point of "undefined behavior could format your hard drive" is that if your code exhibits UB, the compiler is not required to translate it "correctly", and you can't make an attempt to reason about the behavior of the program.
See also: "What Every C Programmer Should Know about Undefined Behavior": https://blog.llvm.org/2011/05/what-every-c-programmer-should...