We have known for more than a decade now that training machine learning models on huge user data sets allows to predict a lot of things with decent accuracy.
Twitter has been gathering a lot of data on all of its user, it is expected them to be able to predict interests like (and much more) this if you use their service.
No need to spy on your smartphone beside what you submit willingly https://hbr.org/2012/09/use-big-data-to-predict-your-c
The technique they use does not really change to the issue.
It’s also not necessarily more secure than third party cookies like you claim? You can refuse those cookies and not all website use them, while all website ends up in browsing history.