You can to some extent do it without that much motion as well. Basically, you're "falling" to one side and getting momentum, and then you "save" the fall by twisting back getting the bike under you, and that instead puts the momentum forward.
I would like to add that you are not just "turning the handlebars" - you need to apply a lot of force to get the forward action to take place.
Pumping is fun skill, easy to get the hang of with a little dedicated practice, and a prerequisite for BMX racing or any advanced MTB riding. Its also extremely inefficient for forward motion. You don't see any TDF guys using pump motion unless they're saving a crash.