Universal entrainment mechanism controls contact times with motile cells