As far as I understand, the usual approach executed by Google
et al is first figure out your demographics data server-side, and then use that data to send targeted advertising to your device when it requests an ad.
Apple, meanwhile—having direct access to your phone's OS—just pre-download a full ad-inventory database to your device, and then your device, using demographics data stored only on the device, targets itself; Apple's servers don't learn anything about you, only what ads your phone decided to show you.