The basic building blocks of any good concrete job are sand and gravel compacted into a layer beneath the concrete. Sand provides a cushion for the concrete as it settles, allowing the concrete to settle slowly. If concrete settles too quickly the slab will crack.
Gravel acts as a drainage layer for the concrete. Since soil tends to retain water, and water expands when it freezes, it will buckle the soil and the concrete on top. Gravel helps provide drainage for the concrete slab, giving the water time to evaporate rather than simply waiting in the soil for the colder temperatures to arrive.
Because concrete needs a solid, stable base in order to have adequate time to cure without sinking, compacting the base layers beneath the slab is important. Regardless if you are using sand on top of gravel or gravel on top of sand, everything needs to be compacted so that it is solid enough to withstand the weight of the slab. This is either done by a hand-held machine tamper or by large roller machines in commercial projects.
The reason that gravel and pebbles are used for the base is because they can compact tightly enough to give the slab support while at the same time allowing for drainage. You cannot use large rocks as the base for concrete. Instead, gravel or pebble-sized rocks need to be used. The size of rocks you need to use depends on your type of concrete structure, and you should always hire a structural engineer to help you plan.