The hand-withdrawal reflex includes just the spinal cord, so it requires some time before the data about pain registers itself with the brain.
When we feel pain, for example, when we contact a hot stove, sensory receptors in our skin communicate something specific by means of nerve fibres to the spinal cord and brainstem and after that onto the cerebrum where the vibe of pain is registered, the data is processed and the pain is felt.