The profit margin figure cited for grocers is the margin on their "main business" — i.e. revenue on grocery goods sold minus cost of grocery goods from suppliers.
But this ignores other ways grocers make money (at much higher margin) — e.g. by charging their suppliers for shelf space/positioning.