Objects float when they have a density less than water. Some natural objects that have a density less than water include oil and wood.
The more dense an object is, the heavier it is, and the more it will sink. In order to float, a liquid must have less density than water. For example, when combining oil and water, the oil floats because it has less density, and is therefore lighter than the water.
Any object whose molecules are tightly packed is a dense object. For example, a penny is dense because its molecules are tightly packed, and because of its density, it sinks. A cork has loosely packed molecules, so it is less dense and floats.