The story
Originally US, probably by reference to slang terms like “swelled head” for someone with delusions of grandeur; a psychiatrist would remove such delusions, thus figuratively shrinking the patient's swelled head.
Etymology from Wiktionary, CC BY-SA 4.0.