When the AI works for you, it doesn't get to see all of your knowledge, only the excerpt needed for the task. Here is exactly what leaves and what stays.
For an answer, your system pulls the relevant passages from your files and sends only those to the AI model. Anything not needed for the question stays on your server.
Under the providers' terms, the models used do not learn from your inputs. So your content does not improve anyone else's AI product.
For especially sensitive fields (law firms, medical practices), a pre-stage can sit in front: it replaces names and companies with placeholders before sending, and puts them back in the answer. The model only ever sees "Person 1", "Company 1".