There isn't a link for it, it's something I've picked up on in biology classes through the years.
The biological ability to feel pain requires a nervous system of some sort, and an area of the brain to process the signals. For an individual to actually "feel" the pain, rather than a machine-like reaction to stimulus, some sort of consciousness is required. An ant, which is not conscious, will react to a flame, but there is no personality within it capable of feeling this. Its reaction is purely mechanical. Humans have a highly developed consciousness, thus we are very capable of feeling pain. A fetus, given its brain development, has little to no capability for feeling pain - on par with small mammals such as mice.