These traits are likely adaptations related to the animals' high-fiber herbivorous diet, and evolved independently of similar traits seen in some reptilian groups.
There have been several theories regarding the evolution of large prickles on plants endemic to islands that lack any mammalian or reptilian herbivores.