Definition is always a difficult thing to do. The definition of something rests inherently on comparisons with other, similar items, on establishing a common category with other things. Thus, The Beggar's Opera, as the first successful example of its type, is a difficult play to define.
The Beggar's Opera is a ballad opera. A ballad opera is a play:
The Beggar's Opera is also a political work with satiric elements. It has two main satiric thrusts, each of which serves to compliment the other. The specific aim of the work is to present a satire of the London of 1728, and to point a finger at the corruption of both the Prime Minister's government, and the system of prosecution and criminal justice that was so effectively manipulated by thief-takers like Jonathan Wilde. The temporally located concern over the immediate political and social environment serves as a means to concretize and represent the more elemental questions of inequity and corruption in themselves, and the effects that poverty and crime have on them. This, then, is the subject of The Beggar's Opera that spoke so strongly to Berthold Brecht in prewar Berlin, and the subject that continues to bear relevance to our current time.
Besides its satyric and narrative content, The Beggar's Opera is a work of metadrama; that is, it is a play about theater and stage-representations. There is a framing narrative, in which the Beggar (represented as the playwright of the piece) discusses the play with the Player (a stylized representative of the actors). In this frame, the Player and Beggar make references to the opera, and specifically to specific individuals in the London Opera scene.
In addition to the external links with the opera of the time, and its "Similes that are in all your celebrated Operas; The Swallow, the Moth, the Bee, the Ship, the Flower," this section focuses the reader/auditor's attention on the nature of this play as a representation. Later, the framing narrative is brought in again, this time serving to alter the course of the narrative by changing the ending from a hanging to a reprieve. (Shown at the tail end of this clip This focus on the nature of the play, and on the control of the internal dialogue by the external forces of convention and public taste serve as a method of focusing the play's satyric energy, not only on the specific people mocked therein, but on the broader social constructions and human frailties that lie behind them. The "taste of the town" will not stand to see Macheath hanged; however, the deliberately contrived manner in which Macheath is reprieved pointedly questions the social system that allows this to happen in other cases.