Resistance evolution, from genetic mechanism to ecological context