Like Oscar Wilde, GBS based his witty comic stride on the Victorian London Society, particularly the pomp and circumstance of their exaggerated self righteousness, their holier than thou attitudes, the ridiculous set of social rules and expectations that they imposed on themselves as a social class, their obsession and cutthroat ways to reach the aristocracy, their judgmental ways, the separation of the classes, and the women's need to advance through society through marriage.
As far as Arms and the Man, it was a discussion play in his collection of Plays Pleasant , whose main topic is to identify the reality of war and to attack the romantic ways in which it had been portrayed in traditional plays.
The comic sense of the play comes precisely from the two opposing topics: war and marriage. How some characters such as Catherine, tries to pass for a Viennese woman. How Blutnschli, a Serbian captain, is completely "undistinguished", how Louka wants to rise up the social ladder, how Major Peskoff is actually weak and cowardly. All those things represent the comedy and the unexpected twists, turns, and witticisms that come as a result of GBS's amazing talent.