A bad shower pan leak going through a crack or opening in the slab, and being right next to the foundation, could erode the soil away from the foundation. A broken shower drain under the slab could also cause this.
Before I assumed this was the cause, I would need additional information, and why you suspect this may be the problem.