Spiny things are prickly or barbed, like a porcupine or a cactus. You have to be careful when you pick up something spiny.
There are many spiny plants and animals, including roses, fish with spiny fins, sea urchins, and hedgehogs. They're all spiny for the same reason—as a defense against predators. The barbs or thorns themselves are called spines, from the Latin spina, meaning "backbone" and also "thorn or prickle." You can also use spiny figuratively to describe something difficult to deal with: "It was a spiny problem indeed."