tl dr: It isn't necessary, but it improves the quality of the polish/wax job.
"Claying" (otherwise known as using a clay bar or detailing clay), is a means by which to remove contaminates from the finish of your vehicle which washing alone will not remove. The clay bar creates a shearing action, which basically cuts the contaminates off of the clear coat, then encapsulates the contaminate so as to not create damage to the finish. When done, the finish is more ready to receive polish and/or wax.
The clay bar itself is pretty much what the name implies, though it's not made out of organic or natural stuff, but more-so is a synthetic (man made) clay specifically designed to do what it's designed to do: remove paint contaminates. A typical bar of clay comes wrapped up like this:
They can come in just about any color. When you first pull the clay out of the wrapper, you need to knead it, as in, fold it back on itself and get it more malleable. When actually using it, you need to also use a lubricant with it to ensure it isn't sticking to (or grabbing) the clear coat in the process. Here is an image of what it kind of looks like when in action:
The contaminates are stuck to the clear coat, while the clay bar comes along and intercepts them, absorbing them into itself. To do this correctly, you need to continually fold the clay bar back on itself to further encapsulate the contaminants inside the clay bar. When in use, the clay bar will look like this, and is how you'll know it's working:
You work a small part of the car at a time, ensuring you are keeping the clay bar wet and the lubricant present at all times. If you should EVER drop your clay bar to the ground, get a new one, as the contaminants from the ground can cause big damage to the finish on your vehicle.
You should wash your car prior to using a clay bar so as the clay bar is only picking up contaminates from what is stuck to the finish and not everything which is on the vehicle prior to. It should be a noticeable difference after using a clay bar, especially after waxing/polishing. As was stated, it isn't necessary, but it does make the finished product look that much better.
PS: You can clay bar your windows as well to improve optical clarity.