You can read detailed description about what is going on in Spotlight Search & Privacy. As this is under 'Legal' it should be as exact as it gets. Some excerpts:
Siri Analyzes How You Use Your Devices and Apps to Provide Personalized Suggestions and Better Search Results Using Local, On-Device Processing, and Syncs Across Your Devices with End-to-End Encryption Using iCloud
Siri uses local, on-device processing to learn how you use your devices and apps in order to personalize your experience. Using information stored on your device, such as your Safari browsing history, emails, messages, notifications, and contacts, as well as information contributed by other installed apps, Siri can provide suggestions in Spotlight, Look Up, Safari, apps, and more.
To Make Suggestions and Search Results More Relevant, Some Information Is Sent to Apple and Not Associated with You