I believe it is done with facial recognition cameras. There were dozens of cameras on the high ceilings. And most likely camera lenses in front of items on the shelves. You dont scan any items with your phone at all. You go through a turnstile that only turns if you scanned your Amazon ID. I believe your photo is taken at a dozen angles at that moment.
It won’t work in places where shoplifting is not prosecuted. It doesn’t help if you know who took stuff, if you can’t make something happen to him.