Mechanical forces drive the development of bacterial communities