The Victorian era refers to the time of Queen Victoria's reign from 1837 to 1901. The Edwardian era covers the reign of King Edward VII from 1901-1910 and is sometimes extended to include WWI, which started in 1910 and concluded with the Treaty of Versailles in 1919, one of the peace treaties which concluded WWI.
The Victorian era was a time of peace, economic progress and plenty; indeed some would say that the Edwardian comedic play had its start in the latter part of the Victorian era. World-wide, British engineering prowess was in great demand; in fact, the British were at the forefront of engineering and technological advances during the Victorian period. This was the time of the Industrial Revolution, spanning from the 18th to the 19th centuries. The financing of railways by British banks paved the way for better transit of people, goods and raw materials. This facilitated trade and commerce greatly. The sewage system in London was a great feat of engineering progress during the Victorian period. With so much success in English society, the people were ready for entertainment which mirrored their collective sanguinity and national effervescence.
The British comedic play's ancestor was the burlesque. Most people think of burlesque today in terms of scantily clad women and bawdy singing and indeed, there was that aspect of burlesque in both England and America during the 19th century. However, the burlesque entertained the lower and middle classes during this time, lampooning or "burlesquing" the way of life and entertainment preferred by the upper classes. The burlesque challenged social conventions, especially the dress codes for women during the 19th century. We must remember that during this time, there was a decided socio-economic shift, a clamor for better representation in the political arena by women and the lower classes. We tend to think of Victorian culture as moralistic and straight-laced, but the suffragette movement gained steam during the Edwardian era. The plight of the working classes and the abuse of workers in the factories of the Industrial era clamored for attention. The burlesque and eventual comedic plays were manifestations of these percolating tensions of the era even during periods of prosperity that characterized Victorian and Edwardian society. Also, the Victorian and Edwardian eras saw a rejection of the rationalism of the Georgian period; romanticism and the mystical experience were adopted into plays and literature during this time.
Here you can read about the paradox of industrial progress and blatant victimization of workers during the Industrial Revolution:
Gilbert and Sullivan's operas were a great example of comedic entertainment which masqueraded as social commentary. "The Sorceror" made fun of British conventions and class distinctions with polished comedy. H.M.S Pinafore poked fun at unqualified people who rose to positions of power and gently lampooned the British Navy at the same time. "The Pirates of Penzance" made fun of duty, familial obligations, and the British social hierarchy. "The Mikado" was in effect a satire which lampooned the corrupt nature of British government. Corrupt individuals in power possessing few qualifications for office wormed their way to the highest levels of authority through deceit and shady backroom deals. Although the setting for the play, the costumes and characters were of Japanese origin, Gilbert and Sullivan often used far-fetched ideas such as these to highlight the satire of their comedic musicals.
Another well-known playwright during the Edwardian era was George Bernard Shaw. His most famous play, Pygmalion, was the inspiration for the equally well-known musical we know as My Fair Lady. Shaw's incisive wit and humor was greatly appreciated by his audience. Whether they realized the depth of his social commentary on the rigid British class hierarchy remains to be debated.
So, although playwrights like Oscar Wilde also wrote tragedies, he was more successful in voicing his views on British society through his comedies. In Lady Windemere's Fan, a comedy, he highlights the hypocrisy of British upper class society. Comedy became the vehicle for social commentary for these periods.
Hope this helps. Thanks for the question!
I would like to add that these comedic plays allowed the lower and middle classes to voice their dissatisfaction with working conditions and to draw attention to abuses by the upper classes/industrialists in a non-threatening way. The plays gave them a voice and allowed them to speak without being accused of fomenting dissension. The tragedies may not have worked as well as the comedies as a vehicle for this kind of social commentary.