Plasmids function as independent genetic structures in bacteria, carrying genes that may benefit the survival of the organism. They often contain genes for antibiotic resistance, and are instrumental in gene transfer between bacteria, facilitating rapid adaptation and evolution.