There are some people, especially victims of one or another religion, think that earthquakes are sent by their god to punish humanity for ... and then they give their favourite sin. But the cause is fairly simple.
Look at an orange. It's pretty much a sphere, with an outer rind, and all the nice juicy stuff inside.
The earth isn't so simple. There is all the juicy stuff inside (molten rock, you see it squirting out with volcanoes) and big plates of solid stuff float on top of that. But those solid plates rub against each other.
Take two slabs of wood, and push then hard together. Now, while pushing them together, try to move one of them against the other. Nothing will happen as you start to try to move them, then suddenly you'll get one sliding over the other.
Or. Sit down, and rest your foot on the floor. push your foot forward. Nothing will happen at first, but then after you've increased the pressure, your foot will suddenly move forward, then stop. And you can repeat this a few times.
It's the same with earthquakes. The plates are compressed together but are also trying to move relative to each other. Nothing happens for a while, and then suddenly, there's movement. That shakes everything nearby. That's an earthquake.
In England, we don't get earthquakes. Actually, that's not exactly true, I know of two that I actually felt. For the first one, I was on the phone to someone, and I felt a kind of little bump. I told the other guy on the phone, and after a couple of minutes, he said, "Oh! I just felt it too!". That's because the waves carrying the energy of the earthquake, travel at about 6 km/second. The other one, I just felt a slight "bmp" (not even a "bump") and I read in the newspaper that there had been an earthquake, and somewhat to the north of me, a few slates had fallen off roofs.
They get earthquakes in Japan, California and other places near to places where there are two plates moving. So they have building regulations to make their buildings earthquake-resistant. If you live somewhere that has earthquakes, you can find out of your building is earthquake-resistant.