there are nearly 20 tectonic plates that are along the earth's surface that continuously move past each other
when these plates stretch or squeeze huge rocks from at their edges and the rocks shift causing an earthquake
you can visualize an earthquake by holding a pencil horizontally in the air and applying force to both ends by pushing down on them
eventually the pencil will break somewhere