Earthquake cause shaking of ground in all three directions – along the two horizontal directions (X and Y, say), and the vertical direction (Z, say). Also during the earthquake, the ground shakes randomly back and forth (- and +) along each of this X, Y and Z directions.
All structures are primarily designed to carry the gravity loads, i.e. they are designed for a force equal to the mass M (this includes mass due to own weight and imposed loads) times the acceleration due to gravity g acting in vertical downward direction (- Z). The downward force Mg is called the gravity load. The vertical acceleration during ground shaking either adds or subtracts from the acceleration due to gravity. Since factors of safety are used in the design of structures to resist the gravity load, usually most structures tend to be adequate against vertical shaking.
However, horizontal shaking along X and Y directions (both + and – directions of each) remains a concern. Structures designed for gravity loads, in general, may not be able to safely sustain the effects of horizontal earthquake shaking.