1. Yes, soil erosion is one factor.
Also....
2. All foundations must be taken to a depth of 300-450mm below ground level, to allow for seasonal factors, and their impact on soil property changes at the edge or below the foundation;
3. Clays shrink on drying and expand when wet; In some countries where "frost" is common foundations are taken to depths of minimum 600mm (2 feet);
4. Foundations and slabs on fill (made ground), will see the fill settle, leaving gaps around the edges as seen in the picture;
5. When pouring a slab on ground make the edges of greater thickness (deeper) - (a) to stop the thin slab 'curling' at the edges (b) to stop soil erosion.
6. Read a good book on foundation design - Bowles (US) or Tomlinson (UK);