A scenario where bacteria will undergo sexually reproduction instead of taking the "safe route" and reproducing asexually.

I know that they reproduce sexually when conditions are not favorable and will enter a dorment stage until conditions get better but what scenario would represent that.