Post-herpetic neuralgia occurs because of nerve damage following an episode of shingles (herpes zoster infection).