Everyone here is right on the money about concrete, but it doesn't always crack. A couple of things you need to do in addition to a compacted substrate (compaction must be done in shallow layers to be effective, you can't dump 10" or so of gravel in a hole and run over it with a vibratory compactor and call it a day). One sure fire way to make sure your substrate is solid, is to puddle the daylights out of it with water. It's time consuming and messy but it works great. Also make sure that the stuff you are pouring on is well drained. We always put about 4 to 6 inches of crushed stone under a slab. If you live in an area subject to frost be sure that the edge of your slab at any door opening goes all the way down to your footing. I have seen many jobs where the foundation of the garage is backfilled and the fill/gravel runs right over the footing where it is depressed to allow for the door opening and then the slab is poured. If you think about it you now have a concrete sandwich with gravel in the middle. Moisture will wick through the gravel that is over the footing and under the slab and it will heave and crack garanteed. Another cause of cracking that often does not get planned for is shrinkage. If you have a slab with a dog leg in it for instance, it will most likely develop a crack from the crotch of the dog leg, radiating to the next closest edge across the slab due to shrinkage as the slab cures. This is a good place for an expansion (contraction?) joint. If you have any doubt about concrete shrinking as it cures, just look closely at the joint between your slab and your foundation walls in your cellar or garage. That concrete was wet and right up against those walls when it was poured but now you will probably see a gap there.