Well you have to remember that C compilers, due to historical reasons, are fairly dumb.
If you do printf("%lf", 5); the compiler will generate code to pass the integer 5 and a pointer to the string "%lf" to the library function. That's already a mistake because the data type does not match the format string type. Some compilers will catch that because they do a thorough check. But there's nothing in the standard that says they have to.

Once the library function 'printf' starts, according to the format it will attempt to extract floating point data. Yet there is an integer. The misinterpretation of data at this point will result in undefined behaviour. However if you study the machine code, nothing is unpredictable. I’m sure the result can be explained. It’s just not something that can be said to be universal behaviour across different compilers.