With Spotlight it's possible to find almost anything on a Mac computer, but to know everything, Spotlight must keep this information somewhere.
Regarding text (txt, doc, pages, etc,) files, Spotlight indexes not only the file name and metadata, but also the content.
What kind of data does Spotlight store and how does it index text files? Does it keep metadata when the file is being deleted?
When you edit work files from flash drive, does it keep index and content of that files after flash drive was removed?