Lampshading is a writing technique that became particularly popular with the rise of geek culture. Basically, when a situation occurs in a fictional work which is a common trope, or reminiscent of a situation in a different popular work of fiction, a character might “lampshade” the trope by calling attention to the similarity. This is to assure the audience that the writer is aware of the similarity and might be deliberately riffing on it (or might just be using the exact same trope with no original spin). Alternatively it can be used if something unlikely but really convenient for the plot has happened, to try to prevent the audience getting so annoyed at implausible coincidences that it breaks their sense of immersion (or, alternatively, to poke a bit of fun if it wasn’t something important enough to get them annoyed). Lampshading is related to the idea of genre-savviness, and at one time was seemingly thought of as “clever”, but at this point has been so overdone that people are bored of it, I think.