“Scratching is a natural behavior for cats. Cats scratch to groom their claws, the scratching motion helps remove dead sheaths from their front claws (they usually chew them off their back claws). They scratch to mark their territory. Their front paws contain scent glands, and scratching leaves behind their unique signature on the object being scratched. They scratch for exercise; scratching stretches the muscles in the front legs and all along the back. And they scratch simply because it feels good.”
Ingrid King in The Concious Cat, look at the full post.