I occasionally spanked my kids when they were younger, always as an immediate corrective action when they were about to do or had done something dangerous. As others have described, it's basically a light swat to get their attention, rather than a painful punishment. Now that they're a bit older, there is no good reason to put my hands on them. They can communicate just fine and they can understand when I want them to do (or not do) something. I can also punish them by taking away privileges. There's just no need to hit them.
My parents used spanking as punishment after the fact, which I never found very effective for anything. I just got better at not getting caught. It didn't "fix" any behavior.