https://arxiv.org/pdf/1906.05856.pdf
It's done using an ML model.
The thing is, I don't understand what signal it's using to determine whether the Liquify tool in Photoshop has been used. And from skimming the paper, I'm not sure the authors know either. But it's not detecting seams or compression artifacts or other common signals, because Liquify doesn't generate those.
Only thing I can guess is that it's picking up on anatomically impossible or extremely unlikely facial structure, which our own brains don't pick up on?
My only other guess would be some kind of subtle mismatch between lighting and skin texture/angle but I don't think the resolution is high enough, plus makeup and smoothing in Photoshop makes that even harder.