The antibiotics interfere with chemical reactions that bacteria need to survive, but that human cells do not employ. In penicillin, a chemical binds to the enzymes that are supposed to help in the maintenance of the bacterial cell walls. So it impedes the repair process until finally the cell wall fails and the bacterium dies. Human cells do not use those enzymes.
Chat with our AI personalities
Because penicillin is baticidal (i.e. it kills bacteria). It works in a ver specific way on their cell walls. As viruses don't have cell walls, penicillin has no action on them.
This means no more antibiotics for colds!
Penicillin does not affect viruses so it is a waste of time taking it in these circumstances. It can be counter productive to use antibiotics "just in case" they help, as this is likely to increase the number of bacterial strains which adapt to become resistant to antibiotics in common use. This is how we come to have problems like MRSA and ad campaigns saying "antibiotics will not cure a cold".