Partially because, like all flying birds, have hollow bones and low weight and large wing area and strength per their mass, so they can fly.
Oil in feathers helps them float, too. Try pouring dish soap on one--he will Struggle to stay afloat! The now-wet feathers absorb many times their area in water, causing density of the duck to approach that of water. Water skeeters ride on surface tension of water--a little soap will make them sink, too.