How are bacteria, which have been long recognized, mutating into new strains with concerning properties?

Staphylococci and streptococci

Staphylococci and streptococci have become more prevalent in community-acquired settings. How are bacteria, which have been long recognized, mutating into new strains with concerning properties?