Azithromycin attaches to the part of the bacterial ribosome that builds proteins. It blocks protein making and also keeps that part of the ribosome from being put together. Without new proteins, the bacteria cannot grow. Bacteria can resist it by changing the spot where it binds, and bacteria that resist erythromycin usually resist it too.
Tissues such as the lungs, tonsils, and skin soak it up and release it slowly, so it stays in the body for days. People should start to feel better within the first few days of treatment. Allergic reactions to it sometimes come back after their treatment ends, and the label notes this may relate to how long it lingers, though that link is unproven. Like other drugs in its class, it can delay the heart's electrical recovery between beats, which is how it can trigger dangerous heart rhythms.