They're tracking people using their phone's advertising ID. How to Disable Ad ID Tracking on iOS and Android, and Why You Should Do It Now
On newer versions of iOS apps have to ask for permission to access your device's advertising ID; Facebook was very unhappy about that. Turning off Settings -> Privacy & Security -> Tracking -> Allow Apps to Request to Track will (should?) keep apps from getting your advertising ID. I'm not sure if Android has anything like that, but Google is an advertising company so my guess is No.