The theory of intertextuality assumes that all works of art are created within the artistic tradition or cultural discourse and refer to preceding works or art.
One aspect of this is sometimes called "inspiration", where one artist feels inspired to create a piece of art by another artwork. But intertextuality goes beyond inspiration in that it encompasses "schools" of artists addressing similar topics or using similar stylesartists working in the same age or cultural context and many other phenomena of similarities and relations between "texts" (where "text" is anything using a set of rules to express information, so a film or painting is also a "text" in this sense).
The epigraphs that you ask about are a way for an author to make explicit the connections to other texts that he wants to encourage the reader to consider in their reading.
But epigraphs have also become a fad so you might want to avoid them, especially if you aren't completely sure about how to use them.