How does the concept of resonance work?

If something wants to move at a certain frequency, like a kid on a swing, then if you push it at that frequency it moves faster and faster and further and further.