We speak of « play within the play » when the play, scene, skit or sketch has as its theme the theatrical performance itself.
This can lead to a « mise en abyme » (self referentiality): during the play, the stage becomes, for a time, the theatre for another play performed by some of the actors, and to which the other actors playing the role of the audience attend. Shakespeare (Hamlet) and Molière (L’Impromptu de Versailles) both used this technique.
One can also witness a subversion of the codes and conventions of traditional theatre: the fourth wall is broken, the actors play themselves and speak of their personal problems by directly addressing the audience and engaging them; the author, director, stage manager or even the spectators intervene in the show; the actual people, space and time of the performance become the characters, location and time of the show, to the point that the actual spectators eventually no longer know what is fiction and what is reality.