The driving frequency : earthquake has a frequency. The natural frequency : buildings have natural frequency When the driving frequency approaches the natural frequency, resonance take place. The building shakes at large amplitude.
The driving frequency : walking motion exerts a periodic force side ways The natural frequency : The bridge has a natural frequency and it is also not suffiently damped. Hence resonance can take place.