The noun dêmagôgos first appeared in Thucydides’ history, mostly in a neutral, only slight disparaging way (usually in reference to the obstreperous Cleon), in its literal sense of “leader of the people.”
But very soon — in later fifth- and fourth-century authors (e.g., Aristophanes, Xenophon, Aristotle, the Attic orators) — both the concrete and the abstract nouns (demagogue and demagogy/demagoguery) and the verb (to demagogue) became ever more pejorative, describing crass popular leaders who alternately flattered and incited the masses (ochlos). Their trick was to obtain and expand their own personal power by clever rhetoric directed against the better off, coupled with promises of more entitlements for the “poor” paid for by a demonized “them.”
We often associate demagoguery in the U.S. with wild right-wing nationalists or cultural chauvinists, such as Joe McCarthy or Father Coughlin, or with folksy Southern “spread-the-wealth” populists, such as William Jennings Bryan (“The Great Commoner”) or Huey Long. And, of course, abroad there were no better demagogues than Mussolini and Hitler, who both started out as national socialists and then united the classes by transferring class hatred onto foreign bogeymen, in a fashion we later see most effectively in Juan and Eva Perón.