It looks like the less expensive items, the sundries. It's the electronics and the medication that they are protecting, I asume.
HEB, a Texas-based grocery chain with a fairly large selection of general merchandice, does not need to do this. There's no "greeter" checking for receipts, no monitors at the self checkout to make sure you scan everything, and no armed security or police.
How do they do it? By charging just a few pennies more for each item. That slight difference in price keeps out undesirables. You don't see people that look like they just crawled out of bed at four in the afternoon, you don't see couples screaming at each other in the parking lot, and you don't see parents ignoring their kids while they walk among parked cars.
It isn't about location and neighborhoods. We have an HEB that is right across the street from Walmart, but if you go into each one after the other, you would think they were in different countries.