In order to ensure growth of only transformed bacteria (which carry the desired plasmids to be harvested), a marker gene is used in the destination vector for selection.  Typical marker genes are for antibiotic resistance or nutrient biosynthesis. So, for example, the "marker gene" could be for resistance to the antibiotic ampicillin. If the bacteria that were supposed to pick up the desired plasmid had picked up the desired gene then they would also contain the "marker gene". Now the bacteria that picked up the plasmid would be able to grow in ampicillin whereas the bacteria that did not pick up the desired plasmid would still be vulnerable to destruction by the ampicillin. Therefore, successfully transformed bacteria would be "selected."