An earthquake is a natural calamity in which the shaking of the surface of earth occurs. This is caused by the release of energy in the lithosphere which is responsible for generation of seismic waves.
Most of the earthquakes happens at or near the boundaries between the tectonic plates of Earth as it is the place where there is large concentration of faults. Some faults cracks due to the stress and strain of the moving tectonic plates.
The three types of pf plate boundaries are spreading zones, transform faults and subduction zones. Most earthquakes occur along the boundaries of plate tectonics due to the effects of the earth's mantle layer that acts as a recycling agent and recycles 99% of the earth's surface layers from above.
Various tectonic forces and process act son these slabs and rocks from above and hence through the activities of erosion and denudation of the rocky masses these plates collide with each other as the earth is it's self not static its dynamic and moves continuously on a regular basis and hence changes take place on the surface of earth.
Thus it can be seen that the earthquakes and volcanic events occur at the plate boundaries and hence produce or are responsible for the various activities.
The mid Atlantic ridge shows seafloor spreading and alignment continental such as south America to Africa shows that the continent fit together or the animals dispersed across them. The mountain ranges like the Appalachian or British aisle
Basically the Earth is layered because of gravity. The earth formed in the molten state. The liquid iron which is very dense fell to the center. The rest of the earth is made up of silicate materials with SiO2 being the main component.