Every object in the universe has a natural frequency of it's own. When frequency of external force becomes equal to natural frequency of oscillation, resonance takes place. During the condition of resonance, amplitude of vibration becomes maximum.
Bridge can be considered as stretched string. If soldiers march in steps and frequency of marching steps is the same as that of frequency of bridge, then bridge will be set into resonant vibrations and will collapse. That is why soldiers are asked to break their steps while moving on the bridge.