Detailing clay is a synthetic resin material, almost just like the clay that you played with as a kid, but more elastic

This, when smoothly massaged on the paint (always using a lubricant), will pick up the contaminants that are stuck on the lacquer.
You would do the following (after washing your car properly):
1. Warm up the clay in a glass of hot water. You need to keep the clay warm, so it retains its full elasticity. This is important specially when its cold, since hard clay can cause some marring on the paint.
2. Apply lubricant on the paint, like detailing spray or a specific claying lubricant.
3. Glide the clay over the paint, only applying gentle finger pressure.
4. Keep it lubricated!
5. Knead the clay to always expose a clean surface.
You will notice that after claying a certain area, the paint will go smooth. This is because you have picked up all the contaminants that were stuck, like pollution fallout, tree sap, etc., leaving now a clean and ready paint surface for polishing.
If you need to know what you should buy to have a start on your Detailing Adventures, I have made a thread some time ago with some my personal recommendations:
Washing my BMW M: What do I need?
enjoy!