If you watch your cat play with a soft toy they will typically grab it with their front paws, roll on their back and kick it with their back legs. Sometimes they will do the same thing to you when you try to pat or scratch your kitty. Your cat will hold on to your hand, forearm or shin and kick at you with their hind legs.
This behavior has two meanings. It is a fight response and a play response. When cats wrestle with each other they tend to display this behavior. When your cat is in the mood to play and you reach to pat her she may grab you hand and kick it with her back legs out of a sense of playfulness. If she scratches you it is purely unintentional as scratching at another cat who has fur will not cause abrasions.
Cats also use their back legs when they are attacked. During a defensive incident your cat knows that 5 pointy objects, four legs and teeth, are more effective as a defensive weapon when compared to just teeth. By rolling on their back in an attack situation your cat is fully armed and ready to protect himself.
Sometimes a cat will act this way when you attempt to interact, not because they want to play, but because they want to be left alone. So if you try to play with your cat and notice the back legs are kicking a little bit harder than usual it may be their way of saying stop. Keep in mind too that cats will roll on their back around you because they feel safe. This may not be an invitation for a belly rub so be sure to approach with caution.