How are suitable epigraphs in books found? Sometimes we see some scientific books (for example in the fields of computer science, game theory, ...) start their chapters (mostly the first chapter) with epigraphs from famous people, movies, an important event like famous conferences....
How the writers find these sentences? Since they are more or less related to the subject of the book's (or chapter) discussion, it seems that they can't be found accidentally by watching a movie during the writing process, or just the nice sentences be gathered during the time.
Is it practically possible to search on the internet for a suitable quote just at the time of preparing that specific writing/book/presentation? What should be searched for? Could anyone please give me some practical directions?
The man who does not read has no advantage over the man who cannot read.
― Mark Twain

Read a lot and remember.  Write quotable quotes in a notebook if you feel you might be able to use them in the future.