An Indian legend says that our planet is held up by four elephants that stand on the back of a turtle. The turtle is balanced on top of a cobra. When any of these animals move, the Earth trembles and shakes: an Earthquake happens.
Some other people tend to explain this speaking about lithosphere, asthenosphere, tectonic plates and so on. Here you have some stuff about that.
More legends about earthquakes here.