It was political satire written for the time period when the question of gold or silver backed money was prominent. "OZ" = ounce and referred to the gold silver argument. All the characters, Dorothy, the farmer family and Toto,the Wizard, the Munchkins and the Witch and her flying monkeys all were readily identifiable public figures in that era.
It must have worked because (thankfully?) we never got president William Jennings Bryan...
I heard that the Scarecrow represented farmers; the tin man represented the industrial workers, the wicked witches represented the railroads, the Wizard was President McKinley, and the cowardly lion was William Jennings Bryan [the “Cross of Gold” version, not the Scopes Monkey Trial version.] It’s funny how he made his reputation being a “man of the people” populist, but is remembered today as an evolution denier.
Don’t recall who Dorothy was supposed to be.