A problem play dramatizes a social or political problem. While there have always been problem plays, the term is most closely associated with a group of playwrights that emerged in the late nineteenth century, including Shaw. Pioneered in the later nineteenth century by Ibsen, the problem play was a pushback against the garish melodramas and burlesque comedy that provided escapism in the mid-nineteenth century.
A problem play has a realistic setting and primarily involves characters who represent different sides of a social issue. In Pygmalion, the issue at the forefront is whether social class is genetically determined or socially constructed—or as we might say, a product of nature or nurture. Many middle- and upper-class people in Britain in the early twentieth century still thought working-class people were genetically inferior and that, therefore, it was a waste of time and money to spend resources to try to educate them or improve their lives.
In Pygmalion, Shaw shows that it is not differences in ability or intelligence that holds the poor back, but lack of opportunity. Eliza learns the right accent, dress, and manners to "pass" as one of the beautiful people, and once she does, there is no discernible difference between her and a duchess. In showing how intelligent and tenacious Eliza Doolittle is, Shaw skewers upper- and middle-class pretensions of superiority.