Wow that's a good one :). Think about it like this. When you put antibiotics in place where bacterias live, probably most of them will die, however there might be "some" who are resistent to the antibiotic by their nature, (mutations etc.) so among the bacterias which were exposed the antibiotics those resistent ones will survive. And bacterias have a system for exchanging DNA to make each other more resistant, its called "conjugation" look it up. By conjugation they give each other genes which will help them survive. So if we summarize, those who are already resistant survive (which is a cause of natural selection in an environment of antibiotics) and help others resistant too.