References? Oh, all over the place. Classic literature, pop culture, some of my own stories, art, music, the list goes on...
But personally, I like taking it to past reference and into character growth. A couple chapters in one of my novels was specifically dedicated to one of the main characters introducing another character to his D&D group. It gave me a chance to show off personalities, introduce minor characters (that become... well, not main, but major supporting characters later)... and if it just so happened that instead of inventing a new plot, I used a truncated novel of mine as the basis of the game's plot, then that was a happy coincidence.
But mostly that subplot existed to display the humanity of a character who was (intentionally) hard to empathize with... and then she wore a tarantula as a hat... P. Metallica, no less. Look 'em up, they're beautiful. Unless you have arachnophobia, in which case don't look them up.
In any case, that chapter took her from least liked character to tied in first place as best girl.
In addition to that, I've used a (very opinionated) conversation about Shakespeare to introduce one character while testing two others' comfort zones. I had a date scene with the characters watching The Glass Menagerie and drawing parallels with their own home lives (needless to say, not happy lives). One planned future story will be built entirely around a group of historical investigators tracking down Frankenstein's Monster, because that was a diary in the setting, not a work of fiction.
And, in a display of reality being stranger than fiction... I accidentally predicted Riri Williams almost six months before Marvel announced her, during a conversation where I made fun of Hollywood by taking elements (and names) directly from Mel Brooks' "The Producers". And *that* chapter was also meant to flesh out a character who was inferred to be a brilliant man, but to that point in the story hadn't had a chance to truly demonstrate it.
So, yeah... what do you call references that are lifted above inside joke, and become significant plot moments?