A genetic mutation like with everything else. It happens in the wild very rarely, but can't normally propagate to the next generation. Breeding two animals with the same anomaly is how we can get full clutches of these abnormal animals like we see all over the forums.