Gene exchange drives the ecological success of a multi-host bacterial pathogen