Years ago, manufacturers of felt hats used mercury to treat the wool, which made it easier to pound the fibers into felt.
Mercury poisoning attacks the nervous system, which caused many hatters to develop tremors and then madness.
In Alice’s Wonderland tea party, she met not only a Mad Hatter but also another descriptive expression, “mad as a March hare.”
The hare breeds during March, so he might be excused for his absurd antics.