When you have homeowners insurance and have earthquake endorsement or earthquake insurance coverage on your home added to your insurance policy the earthquake endorsement covers any damage to the houses structure caused by an earthquake.
For example if you had an earthquake and the houses foundation was damaged as a result of the earthquake shaking the house then the foundation repair would be covered.
Or if your house fully collapsed and was a total loss due to an earthquake then the earthquake endorsement on your homeowners insurance policy would cover the cost to replace your home.
If you live in an area that is prone to earthquakes then having earthquake insurance or an earthquake endorsement is a good idea and sometimes may be required by the bank if you have a mortgage on the home.
If your area only gets little earthquakes that very rarely cause any damage then it might not be worth the extra cost to get earthquake insurance or ground movement coverage on your home.