Antibiotics stop the work of bacteria invading the body. This gives the immune system time to attack the bacteria and get rid of the infection.