Normally, when an app opens a document, details of that are recorded by Launch Services, part of macOS which operates many of the features associated with the Finder and common human interface. Launch Services adds that to the list of documents opened by that app, and puts it into the list shown in the app’s Open Recent menu command.