when you hammer a nail, the compression forces are huge, sending shockwaves through its body, but the duration of the loading is just a fraction of a second. Smash the nail hard enough and it doesn’t have time to buckle. Part of the reason for this is the strange behavior of metals when loaded. The load at which they deform can depend on how quickly that load is applied: the quicker it’s done, the more force a metal can resist without failing.
Roma Agrawal in Nuts and Bolts