Bacteria first evolved over 3.5 billion years ago and have adapted to their environments over time. They diverged from archaea early in their evolution. Bacteria can be found in diverse environments due to their ability to adapt through mutations and genetic exchange between organisms, allowing them to evolve rapidly in response to changes like the emergence of antibiotics. Mobile genetic elements like transposons help accelerate bacterial evolution by spreading genes within and between species.