Floating and sinking are due to density. If something is heavy for its size, it has a high density. A pebble is heavy for its size compared to a popped popcorn kernel. If an object is light for its size it has a low density. Imagine a big bowl of popcorn compared to a big bowl of pebbles. The heavier bowl (pebbles) has higher density.
Why do some things float, while others sink? You might expect heavier objects to sink and lighter ones to float, but sometimes the opposite is true. The relative densities of an object and the liquid it is placed in determine whether that object will sink or float. An object that has a higher density than the liquid it's in will sink. An object that has a lower density than the liquid it's in will float.
You can really see relative densities at work when you look at a heavy object floating and a lighter one sinking. For example, imagine putting a small piece of clay and a large, heavy wax candle in a tub of water. Even though it's smaller and lighter, the piece of clay has a higher density (it's heavier for its size) than water and therefore sinks. Even though it's larger and heavier, wax has a lower density (it's lighter for its size) than water, and it floats.
Sinking and floating applies to liquids too. In this activity, we compare the density of salty water and fresh water. Salty water is more dense (heavier for its size) than fresh water. As long as the two kinds of water don't mix, fresh water floats on top of salty water.