Pressure is defined as the total force per unit area.
The ends of the nails and pins are made sharp in order to minimize the area which in turn increases the pressure.
So when you hit the nail on its head, even a small force converts into a large pressure due to the small area of the tail and the nail is able to insert into the wall.
The area of the pointed end of the nail is much smaller than that of its head. The same force produces sufficient pressure to push the pointed end of the nail into the wooden plank.