Usually it is at a place where two plates are stuck against each other and pressure is building up. When it suddenly ruptures, then the Earth's plates rebound. These places are called faults. One of these places is the San Andreas fault in California. This fault runs mostly through Southern California.
Earthquakes can also cause tidal waves.
When a tidal wave is caused by an Earthquake what happens is the Earth moves under the water, displacing it and creating huge waves. A device called the seismograph can measure the magnitude of earthquakes. Earthquakes are very common in other places in the world and are sometimes connected with volcanic eruptions. But earthquakes in California seem to get the most publicity. The last major earthquake in California was the Northridge earthquake.