Antibiotics work on cellulitis by targeting and killing the bacteria responsible for the infection, which typically enters the skin through cuts or abrasions. They reduce inflammation, alleviate symptoms, and help the immune system in eliminating the infection from the affected tissues.