It takes a lot of energy to move the surface of the Earth, even a small fraction of it! Earthquakes can be caused by the same upwellings of heat that cause volcanoes, but most are caused by collisions or slippage between the large floating plates of Earth's crust. These tectonic plates are sometimes moving apart, building up stress for a long time until suddenly, the fault snaps with terrible energy.
We can't avoid earthquakes, but it is important to try to minimize the loss of life and property. Since quakes shake buildings, builders try to use designs that will absorb some of the motion. A tall building that will sway a little bit in a earthquake will survive better than one that is very rigid. It's also important for the building to have a very secure foundation in the Earth. If the building rests on soft soil or sand, the vibrations of the quake will "liquefy" the ground beneath the building. Then, watch out!
Back Experiment Experiment 2