There are three specific reasons why domestic cats scratch carpet, furniture, scratching blocks, anything which is suitable to scratch. In the wild a suitably sized tree is ideal.

We all know that this aspect of feline behaviour is perhaps the most important for many cat owners and one which can turn potential adopters away from owning a cat (hair shedding is another reason). It is the reason why very many Americans ask their veterinarian to amputate the last phalange of each toe of both their cat’s front paws. “A cat without claws is not a true cat”.
The First Function
On the Internet, the usual reason given for cats scratching furniture is to sharpen their claws. This is not strictly accurate. It implies that your cat is sharpening his claws as if he were sharpening a knife. What he is doing through vigorous scratching of a suitable object is removing his old, worn out claw sheaths to reveal a fresh, sharply pointed claw underneath. A good analogy is of a snake shedding its skin rather than the actual sharpening of a claw (see a page on cat claw anatomy).

I can remember a lady visiting this website many years ago when she left a short post in which she declared that her cat has lost his claws. She couldn’t understand what was going on. She thought that all the claws of her cat were falling off because of some nasty disease.
Without seeing any photographs it was apparent to me that what she was looking at was the old outer layer of her cat’s claws. They had been left littering the area beneath the armrest of an old sofa. The “ripped out claw” is simply a sheath or the outer layer which is due to be discarded in any case.
Other visitors have mentioned that their cat’s claws had been ripped out but without investigating the matter further I have assumed that what they were looking at the same thing because it does look much like a claw although it is hollow.
The Second Function
The domestic cat scratches in order to exercise and strengthen the protrusion and retraction apparatus which controls the extension and retraction of her claws. This is a vital apparatus in respect of catching prey, climbing and fighting. As an aside, it is now well-known that the cheetah is the only member of the cat family with claws that can’t be sheathed (retracted and hidden). This allows for a firm grip on the surface upon which it is running because speed is the means by which this cat catches prey.
In addition and along the same lines, when a cat is scratching he is also extending his back and stretching.
The Third Function
This is a hidden function which is not quite so obvious. It concerns scent-marking. The classic way that cats scent mark is by urinating horizontally (spraying) onto objects to leave a signal to others that they have been there. However, there are scent-glands on the underside of the cat’s front paws. These are rubbed against the fabric of the furniture being scratched or preferably the scratching post. The scent is squeezed from the glands as the cat rhythmically scratches using left and right paws leaving a deposit of the cat’s personal signature on the object.
Dr Desmond Morris makes an interesting observation in this regard. He says that the reason why domestic cats home in on their owner’s favourite furniture when scratching is because the “cat is responding to the owner’s personal fragrance and adding to it”.
He suggests that buying a scratching post and adding catnip to it might not work sometimes, leaving the owner very disappointment. Personally, I find that catnip does work and I have half a dozen cat scratching, cardboard boards dotted around the house impregnated with catnip which my cat likes to scratch.
However, Dr Morris suggests that “hanging an old sweatshirt over a scratching post might help to solve the problem”. In other words if you want to transfer your cat’s desire to scratch your favorite piece of furniture to a cat scratching post then you should ensure that the cat scratching post has the same scent on it (your scent) that your furniture has.
The quotes are from Dr Desmond Morris. The information comes from me and Morris.