Chance and pleiotropy dominate genetic diversity in complex bacterial environments