The causes of cracks in concrete can be incorrect design, faulty construction or overloading, corrosion of reinforcement, isolated settlement of foundations, creep and shrinkage.
But in foundation for the vast majority of issues, water is the primary culprit. Variations in moisture cause components of the soil to swell or shrink, leading to movement beneath the foundation. When unstable soils are used as a base, the movement is transferred to the foundation. Since soil movement is rarely uniform, the foundation is subjected to a differential or upheaval. The problem shows up in both slab, and pier and beam type foundations.
If all the soil beneath a foundation swells uniformly, there usually is no problem. Issues occur, however, when only part of the home settles. Then, the differential movement causes cracks or other damages.
Proper compaction of soil can prevent settlement cracks in foundation.
The area below the concrete slab has to be compacted properly and in layers so as to ensure against settlement of soil later. If the soil is left loose it will settle over time and create cracks on surface.