Concrete is a strong building material, but when it's used as a foundation for a house, it can develop cracks over time. These cracks can be caused by things such as extreme temperature changes (and the resulting freezing and thawing of the ground); changes in ground moisture, which causes soil to swell and shrink; soil moving beneath the foundation; and seismic events (which don't refer to earthquakes in this case, but intentional blasting done to clear rock in a quarry, or seismic testing done during oil and gas exploration). While you won't be able to stop seismic testing or blasting, you could go to court to try to get the companies involved to pay for any repairs. There are some steps you can take to prevent cracks from beginning, however. During a dry period (when the ground would shrink as moisture disappears), water the lawn around your house in a uniform pattern to help maintain the stability of the soil. Make sure that the ground on the surface is higher than the surrounding ground so that water drains away and doesn't pool against the foundation. And don't plant large trees or too many shrubs close to the foundation, because the root systems can remove too much moisture from the soil, or even push against the foundation and damage it.
If you do wind up getting a crack in your foundation, the good news is that you can fix it fairly easily. The first thing you should do is determine what exactly is causing the crack. (For this you might want to hire a a company that handles foundation repair work.) Use a hammer and chisel to make the crack at least an inch deep, cutting underneath the sides of the crack, and then remove all the dust and debris with a shop vac. Mix up some concrete patching compound, and use a trowel to fill the crack with the patching compound. (Overfill the crack a little bit as you do this, and use the trowel to wipe away any excess material, making sure that the patching compound is even with the surface of the slab.) To help the patch cure, lightly sprinkle it with water several times a day for about a week, then cover it with concrete sealer.