Crabs are classified as Arthropods--animals with jointed appendages and specifically as Crustaceans. Crab claws can be used for defense, food gathering, digging and for sexual displays. They have powerful muscles that allow the crab to pinch and inflict injury. Males generally have larger claws than females and in some species, males may have one pronounced claw. Crabs fight over mates and hiding holes. Sometimes, males will wave their claws in the air as a sexual display, or bang it on a rock to attract a mate. During defensive mode, if a crab pinches a predator so hard, the claw may fall off. However, a new one will grow again. Crabs have a tough exoskeleton covering their body.
Crabs pinch as a self defense mechanism. Hermit crabs also pinch when they're scared of falling like when you're holding them. They also pinch if they feel threatened.