Earthquakes are caused by crustal movement. This can occur on a micro to mega scale. Most earthquakes that cause damage are due to movement of tectonic plates. However, volcanic activity and crustal adjustments can also cause earthquakes. Earthquakes have also been linked to anthropogenic causes, such as fracking and mining.
Damage caused by earthquakes can be economically catastrophic for families, businesses and whole countries with infrastructure and buildings often having to be completely rebuilt. The design of buildings is therefore of paramount importance to avoid being damaged (and to save lives).
Liquefaction pore collapse, accessed 22/04/2020
One hazard associated with earthquakes is liquefaction. This occurs in water-saturated, unconsolidated soils: sandy, silty and gravelly soils are most likely to undergo liquefaction.  The vibrations caused by an earthquake make the sediments lose some of the friction that was holding them together. The grains can then move freely in the water surrounding them, and the soil behaves like a liquid. Soil is much more easily deformed and loses strength when it is liquified. This means it can no longer support heavy objects on top of it, and this can cause building collapse. Buried tanks and pipes may also rise to the surface, due to buoyancy.

On 22 February 2011, Christchurch in New Zealand experienced a magnitude 6.3 earthquake which killed 185 people and injured several thousand. The subsurface of the town was sand and silt, and liquefaction was extensive. The ground behaved like quicksand and caused house foundations to crack and warp. Water and sewerage pipes burst, and their contents flooded the streets and there was irreparable damage to thousands of houses.

Buoyant objects rising to the surface during liquefaction can cause significant issues. In 1989, the Loma Prieta earthquake in San Francisco caused widespread liquefaction. Buried gas mains and pipes began to rise upwards and burst. This in turn lead to widespread fires – another hazard of earthquakes.

There are several different engineering techniques that are used to minimise the effects of liquefaction. If the area of unconsolidated soil below a building is small, a foundation mat can be used. This is usually a shallow concrete foundation which spans the base of the whole building and can transfer loads from unconsolidated zones to adjacent stronger ground. However, in most cases the subsurface strata will be the same for a greater area than the base of a building. In this situation, large vertical piles can be driven deep into the ground, going below the unconsolidated layer to the bedrock. The piles must allow for bending and be connected to the building in a ductile manner, which also allows for some bending. To prevent underground gas and water pipes from warping and breaking they can be connected using flexible connectors, allowing for movement.
These engineering techniques will add to the cost of buildings and therefore are not always employed to areas at risk of earthquake liquefaction. Although, some countries do have strict guidelines on building standards in these at-risk areas. However, as the parable goes “The wise man built his house upon a rock.” (Matthew 7:24-27)