To my knowledge, antibiotics inhibit crutial bacterial functions such as protein synthesis in bacterial ribosomes which causes cell death. To survive, the cell mutates its ribosomes which costs energy and makes them less efficient but functional again. If you are lucky, the bacteria need a long time before finding an efficient mutation. A combination of multiple such attack vectors can further decrease the efficiency at which the bacteria operate, giving your body an advantage. However, finding new attack vectors (which don't interact with human cells) takes on the order of ten years. So resistance is still a big Problem.