Resistance genes can spread through various mechanisms, including horizontal gene transfer (HGT), where genes are transferred between organisms in a non-reproductive manner. HGT can occur through transformation, transduction, or conjugation, allowing resistance traits to spread rapidly within a population. Another way these genes spread is through mutations that can spontaneously arise and be selected for under environmental pressures such as the presence of antibiotics.