Pendulums with the same length have the same natural frequency. When one pendulum swings, the pendulum with the same natural frequency gradually begins to swing due to resonance.
In this classroom model, energy transfer through the support bar is simplified to make the resonance effect easy to see.