The high sugar content in honey causes an ‘osmotic gradient’ (higher pressure on one side compared to the other). This in turn causes a suction like effect pulling fluid into the wound and shrinking any bacteria present.
Gluconic Acid is also present in all honey and is converted into hydrogen peroxide which further helps to kill bacteria.
The level of this activity varies considerably in honey depending on numerous factors such as plant species, the weather, the bees themselves, and how the honey is processed. That’s why normal supermarket honey isn’t as effective at treating wounds.