Block and stone walls are at the greatest risk for this. Severe cracks in block walls can wear away the mortar between the blocks, creating a through line to the outside. Mortar is also to blame in the case of fieldstone basements, letting daylight in as it crumbles.
No matter what your foundation walls are made out of, it’s obviously dangerous when they have degraded enough that you can see light through them.