An earthquake generates seismic waves that pass through the ground. As those waves pass near or underneath your house, it can move from side to side and up and down. The shaking your house experiences depends on how far it is from the fault and the soil under and around it.