Microsoft collects all this information despite having answered "no" to every "do you want to" during setup.
_If_ Apple uses telemetry, it tends to keep it "on device".
Frequently visited locations ? Yup, on device. If you buy a new device, you restart your frequently visited locations.
Anything AI ? Yup, also on device. The only exception i can think of is photos with iCloud enabled. If you store your photos in the cloud, Apple will process them for faces/locations/whatever AI use. That's the reason you can enter "car and dog" into the search field on your iPhone and get all images containing both.