Earthquakes are the vibrations inside the earth and they are seismic waves.
They differ from sound waves in terms of frequency.
Earthquakes cause destruction to building as they originate inside the earth and these waves produce vibrations to the lower part of the building first, which causes an imbalance in the building and the building collapses.
The potential energy stored inside the rocks provides energy to the seismic waves produced due to earthquakes.
Due to this huge potential energy large ocean waves are formed.