The subtext is any content of a creative work that is not announced explicitly by the characters or author, but is implicit or becomes something understood by the observer of the work as the production unfolds. Subtext has been used historically to imply controversial subjects without drawing the attention, or wrath, of censors. This has been especially true in comedy, but it is also common in science fiction, where it can be easier and safer to make social critiques if it is set in a time other than the (author's) present.
The subtext is content "under", and hence, "sub", or hidden beneath, the actual dialog or text. To gather subtext the audience must "read between the lines". This is crucial to a clear and accurate understanding of the word. If it is stated explicitly, it is by definition not subtext, because it is no longer hidden. In fact, writers are often criticized for the failure to artfully create and use subtext. Such writing is faulted for being too "on the nose", meaning the characters always mean what they actually say. Among other things, this robs the text of dramatic tension and can make the whole thing too boring and obvious.
The subtext is often also inserted in narratives where explicit themes are unable to be shown or expressed due to the desire to appeal to a general audience. Examples are sexual or other adult references in a story nominally marketed to children. Their inclusion sails right over the kid's heads but the adults appreciate a chuckling nod to the fact that they too are in the audience.
The subtext is not costumes, set pieces, or design, although these cultural cues may 'set the table' for the understanding and interpretation of the subtext.