Overly elaborate, swanky or pretentious - especially of dress. Also applied to people who act in that manner.
This is an American phrase - which is no big surprise as it derives from the American usage of pants to mean trousers. The first reference to the term in print is in an advert in the Maine newspaper The Bangor Daily Whig And Courier, in October 1843. In that, a company of auctioneers called Williams and Prince advertised the sale of "Fancy Pants - Cassimere". That clearly refers to pants that were fancy. Cassimere was a type of soft woollen twill cloth. Not especially fancy by later standards but quite exotic for Bangor in the 1840s.
By 1870 the term is reported as being used with a hyphenated adjective, that is, effectively as a single word, with our current 'pretentious; swanky' meaning of the term. The Oxford English Dictionary states that the Pennsylvania newspaper The Titusville Morning Herald used it that way in an advert in October 1870:
"Just opened! Still another lot of imported diagonal and basket coatings and fancy-pants cassimers."
Having checked copies of that paper, there are several entries of that advert for October 1930 but they don't include a hyphen between fancy and pants. This suggests that the advert was merely one for fancy cassimere trousers and not with our current understanding of fancy-pants. That 1870 citation of the use of fancy-pants as an adjective is further put into doubt by the fact that the phrase doesn't appear with that meaning anywhere else for another 60 years.
This inclusion from a reader's letter appeared in several US newspapers on 30th December 1930, including The Coshocton Tribune:
"'Dear Fancy Pants' writes someone from down in Texas."
That is a clear usage of the term as a name for someone who wears, or who might be imagined to wear, fancy pants, rather than a description of the pants themselves. The first record that hyphenates fancy-pants, with the unequivocal intention of it being used as an adjective, is from the same paper a few years later in November 1939:
[Ralph] "Bellamy borrowed the money to come west and borrowed some more to rent himself a Beverly Hills mansion complete with swimming pool and fancy-pants butler."
See other phrases that were coined in the USA.