You probably noticed that during an earthquake not all buildings move in the same way…; it may also happen that some fall and other don’t.
This has to do with their resonance
Indeed, all buildings have a natural period, or resonance. The resonance is the number of seconds it takes for the building to naturally vibrate back and forth.
But the ground also has a specific resonant frequency. For instance, hard bedrock has higher frequencies softer sediments.
And if the period of ground motion matches the natural resonance of a building, it will undergo the largest oscillations possible and suffer the greatest damage.
If you want to know more you can check IRIS fantastic resources: Building Resonance: Structural stability during earthquakes- Incorporated Research Institutions for Seismology
and you’ll get to know more about the BOSS model!