Both processes contribute to genetic diversity and influence an organism’s ability to adapt to its environment.