It's a phenomenon, so occurrence can be random. The salts may be in certain clays or sand, but may remain effectively dormant.
Saturation of stored materials, and the tops of part built walls is a significant cause, so there is good practice for that.
Also, voids in the wall from either...