The other answers address adrenaline, but the likely true explanation is that touch and general stimulus are carried by coated (myelinated,, meaning covered in myelin, a fatty sheath) nerves which carry information quickly, but specialized pain nerves are not insulated(unmyelinated) and carry information slower. So you feel the stub quickly, but the pain from the stub doesn’t arrive at your brain until later.
ELI2: Touch nerves transmit quickly, pain nerves transmit slowly.
Latest Answers