Effluent pump, how it will work!

Effluent pump, how it will work!
It depends on 3 gradients : sodium, ATP and proton electromechanical gradient
Proton electromechanical gradient --> bacteria pumps H+ out of the cell --> PH gradient 2-3 --> then H+ can travel down the gradient (H+ concentration outside is higher than inside the cell) --> releases energy --> used to generate ATP (via ATP synthase) or power effluent pump to extrude toxic substances --> drug will be out of the cell
Because this pump is important in ABx resistance --> mechanism of resistance–> Giving ABx with higher PH lowers the minimal inhibitory concentration if the drug (high PH outside the bacteria --> low H+ --> neutralize H+ concentration on both sides
Minimal inhibitory concentration MIC: lowest concentration if the drug that inhibits bacterial growth (from google)
I feel confused about this pump. How can H+ generates ATP when it goes inside the cell! And does all the above explanation right?