It searches a corpus and gives the relevant passages to the model as context. In an enterprise the hard part is permissions: the search must run as the asking user, at query time, or it leaks documents.
See how this works in practice
The console shows the mechanism rather than describing it.