Fundamentally, a word play makes use of two or more meanings that can be ascribed to the same word (sound) or phrase, but not necessarily with the same word spelling, to create a pun (joke).  The pun relies on one meaning being sensible in the given context and another being possible while also being ridiculous, sarcastic or subversive in the current context.

According to Wikipedia  a word play is a literary technique and a form of wit in which words used become the main subject of the work, primarily for the purpose of the intended effect or amusement. Examples of word play include puns, phonetic mix-ups such as spoonerisms, obscure words and meanings, clever rhetorical excursions, oddly formed sentences, double entendres, and telling character names (such as in the play The Importance of Being Earnest, Ernest being a given name that sounds exactly like the adjective earnest).
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence