An important person. Now usually spelled as single word, 'bigwig'.
The fashion for wigs began with the Bourbon kings of France. Louis XIII (1601 - 1643) went prematurely bald and took to wearing a wig. By the middle of the century, and especially during the reign of Louis XIV, The Sun King, wigs were virtually obligatory for all European nobility and 'persons of quality'.
At that time they were known in England as periwigs, which was shortened to wig by 1675.
Wigs were expensive to purchase and to keep in condition and were the preserve of the powerful and wealthy. Ostentation was the order of the day in Bourbon France and over time the wigs became bigger, often to the point of absurdity and requiring of scaffolding.
It isn't difficult to imagine how the term 'big-wig' emerged to refer to the rich and powerful.
The first record of this in print that I've found is G. Selwyn's 1781 Letters in 15th Rep. Hist. MSS. Commission:
"A new point of discussion for the lawyers, for our big wigs, for their Lordships."
This makes explicit the use of the term in relation to the British judiciary, who wore wigs in court - then and now.