when you take an antibiotic, 100% of the bacteria aren't elminated. ever. there may just be one remaining bacteria, a single cell, that had a mutation that allowed it to survive the antibiotic you gave it. let's use PA, for example.
so you have a single cell of PA. for whatever reason, you PA is given the opportunity to reproduce (you got a cold, you weren't compliant with your meds, you were dehydrated after flying, stress from work is wearing you down) and now instead of 1 cell of PA you have 50. They're all identical because bacteria asexually reproduce.
So now you have 50 PA cells that stemmed from that original PA cell that wasn't killed off by the antibiotic. So these 50 bacteria now have resistance to the antibiotic.
Of course, this is a simplified example of resistance, but fundamentally, this is how resistance occurs.
And this is why it's SO VERY IMPORTANT that each and every one of us is compliant with our antibiotics. Whether it's taking Cipro as directed, or not missing a single day of TOBI when you're on cycle.
There are only so many antibiotics out there that work for virulent bacteria such as PA. And pharmaceutical companies aren't developing any more because peope expect antibiotics to have zero side effects. So drug companies are working more towards lifestyle meds, rather than life-savers.