A nail pierces through a body very much like a wedge.
The sharp and pointed tip of a nail acts as a mini wedge.
A nail is a wedge that penetrates through a body on the application of vertical impact load.
Some amount of the vertical load is converted to the lateral load that helps to displace the atoms of the body in the lateral direction and helps in driving the nail.