Puffer fish used to be just plain ordinary fish like any other. but, like almost every animal, it started to get eaten by bigger animals.
So we adapted and now we can inflate and poke out spikes and all the other fish are scared of us!
We got our wonderful spikes through a great process called natural selection. So, the ones that didn't have spikes we would die and then the ones that had spikes would live and reproduce. Now all of us have spikes!!