Nowadays grocery stores do scan the ID, so maybe there is some tracking
The only law involved is the one that penalizes them harshly if anyone underage manages to buy liquor. If fake IDs are less likely to pass that scan, maybe that's why they do it.