thorn to prevent

i remember in the Holy Bible, Paul have problem "thorn in flesh",
Paul ask to GOD: why? GOD give answer: to prevent arrogant,
GOD give "thorn in flesh" to test to teach to make more qualified,

why fish have thorn ?
why flower rose have thorn ?
why babed wire fence have thorn ?

thorn to prevent bad things,
thorn to prevent bad problems,
thorn to prevent bad not happen,

need more understand.