It's a fairly broad question. Wigs as a whole have existed for much of society in one form or another. A primary reasoning has been to display virility and good health, something that age and poor hygiene haven't always made possible.
A major influence in the resurgence of wigs was the plague of syphilis circa 1500s, a prominent side effect would be pustules on the scalp and hair loss. Even natural balding was associated with immodest behavior or poor hygiene. This is also a reference for the sayings about not being able to show ones head.
The powdering is a much simpler question: wigs made of organic material (human or animal hair) attract parasites. The powder (supplemented with various herbal oils) kills parasites such as lice by blocking their airways.