I used to work in a supermarket and in a department store.
Those people you see shooting the shit and slacking off are necessary. The reason why they're there is because if the store suddenly gets packed, they will be split up and given tasks. They're insurance. You can't not have them there, or you'll get customer complaints when they can't find someone to help them, there's too few lanes, etc.
And that's just during the day in front-end customer facing situations. They're constantly called back to inventory to do warehouse-type jobs, even if they're cashiers.