A newfound ability to produce an antibiotic helped a strain of antibiotic-resistant bacteria to take over a hospital.