By eating its fleas. The process of de-worming a cat is not easy. Since cat fleas are commonly contaminated with tape worm egg, most any cat with fleas will have tape worms.
To treat the worms, you need to treat the fleas, if you don't then, as the cat scratches itself it is only a matter of time until another flea goes to its intestinal track and the parasite lays eggs. It is a vicious cycle.
Tape worms in cats are extremely common and most people wont even notice their cat has tape worms. But if the cat has fleas, take for granted he also has tape worms.
I have had several cats and the de-wormer and flea treatments costed a fortune. Now I only have Kairy the cat. She's eleven and she's doing pretty good.
The only way a human can become contaminated with the worm, its if he/she eats a flea, or a tape worm larva. Almost impossible, but it has happened in very rare cases. Contamination with humans is very uncommon.