Answer :

When a solid is put on the surface of water (or a liquid), the weight of water that is displaced (= volume of solid that is below water surface) is the buoyancy force acting upwards on the solid.

A needle made of iron has density higher than water.  It displaces as much water as its volume.  The weight of water so displaced is much less than weight of the needle.
A ship is made of iron as well as many other materials.  It contains a lot of free space filled with air (open).  It displaces a lot of water as its bottom is quite wide.  The weight of water so displaced is quite high and equal to the weight of water.  So  the ship floats on the surface.  The ship is manufactured to have such a base.