Fact 1: threatening behavior by predators causes a porcupine to extend its quills. 
Fact 2: Porcupine quills can be extraordinarily painful.
threatening behavior towards porcupine by predators can cause the predator pain.