Plasmids typically contain an antibiotic resistance gene, so the bacteria exposed to the plasmids are exposed to antibiotics they give resistance to. It will kill all the ones without the plasmid and its resistance, so only the ones with the plasmid, its resistance, and your cloned gene will survive and get turned into colonies