Mercury is used in felting the fur once removed from the pelt in a process called carroting. The secondary nitrous gas released from mercury nitrate turns the fur orange (hence the name), coil up, and shrink making interlocking much easier. The felting process is complex unto itself, requiring steps of heating and moisture to bond and shrink the "batt". After that the felt is worked into a shape called a blank, dyed, and from there blocked into the finished hat shape by a what is likely at least the fifth separate person. Every time the felt is shaped or worked it is either steamed or dipped in boiling water. This releases more vapours from the mercury. So, more than one trade was endangered by this practice. It's thought to have begun in the 17th century, though mercury was understood to have adverse effects not long after. You won't read much about the hatters problem until the 19th century, however, when these industries were moved from outside of the city with good ventilation to crowded industrial areas.