Competence factor
The ability of a cell to successfully incorporate exogenous DNA, or competency, is determined by competence factors. These factors consist of certain cell surface proteins and transcription factors that induce the uptake of DNA. Natural competence is the ability of a cell to bind to and transport extracellular DNA through the membrane and recombine foreign genes into its own DNA through a process called transformation. Horizontal gene transfer is a result of this, where bacterial genes can be transferred amongst same-generation species in a given environment, and competence is the ability of a cell to participate in the transfer. If one cell in a population living in an unfavorable environment has a mutation that results in better survivability, that gene can be passed on to other competent cells to extend the same advantage. Plasmids, commonly used in genetic manipulation, can also be shared through horizontal gene transfer, which is especially relevant in modern medicine concerning the exchange of antibiotic-resistant plasmids. A cell's competence can be determined by its genetics, which is the case for natural competency, or it can be manipulated in order to achieve artificial competence. There are two types of competence-inducing pheromones, these are ComX and CSF. ComX is a ten amino acid oligopeptide; it requires two co-components, ComP, an histidine kinase, and ComA, a cytoplasmic response regulator. ComX binds to ComP on the outside of the inner membrane; ComP autophosphorylates and the phosphoric group is transferred to ComA. This activates transcription of genes in the competence pathway. CSF is a five amino acid oligopeptide and is exported via the GSP pathway. CSF enters the cell through oligopeptide permeate and stimulates the competence pathway at low concentrations (1-5 nM); at high concentrations (>20 nM) competence is inhibited and sporulation is stimulated. Types of competence

Natural 
Most bacterium found in nature are said to be naturally competent, meaning that they are genetically predisposed to be able to uptake foreign DNA. Artificial 
In a laboratory setting, cells are often forced into a state of artificial or induced competence, in an attempt to recreate the conditions of a microbe's natural environment. Forcing competence on bacteria can be done in two ways- one method is a process called chemo-competence. In the laboratory, cells are prepared with ice-cold calcium chloride solutions and become chemically competent. When these cells are then heat shocked (ex., 30 seconds at 42 degrees Celsius), they are able to take up both single or double stranded DNA and can either incorporate it into their genome, or the DNA can exist as a plasmid within the cell. The other method of inducing bacterial competence is a process called electro-competence, and this is done by preparing cells with low-ionic strength buffer. These cells are then treated with an electric shock to make them more permeable, and this allows them to uptake single or double stranded DNA and incorporate it into their genome or have the DNA exist as a plasmid within the cell. Factors determining competence 
Streptococcus pneumoniae gains its competence through the inducer peptide competence-stimulating peptide (CSP). As a resident in the nasopharynx, S. pneumoniae's ability to uptake antibiotic-resistant plasmids can cause dangerous infections. S. pneumoniae excretes small soluble molecules called autoinducers that contain the ability to express genetic competence in other cells. Autoinducers are used as a type of quorum sensing, which will "sense" the population of cells in the surrounding area. Campylobacter jejuni is not competent until the exogenous genetic material is confirmed by the cell to be Campylobacter jejuni DNA. Similar circumstances also occur for Bacillus subtilis, and even then competence develops only in certain media. Pasteurellaceae and Neisseriaceae species tend to select for genes from close relatives. Regulation

srfA operon regulation 
All cellular components that are involved in sensing extracellular factors affect the srfA operon. The expression of srfA will bypass the need for transcription of DNA for only upstream genes. This means that transcription is not exclusive to the direction of DNA it would normally follow, allowing exogenous DNA to be transcribed into the genome. srfA is coupled with an open reading frame, comS. When this reading frame is expressed, it will activate the transcription factor ComK. After ComK is activated, transcription of genes that encode all the necessary components for natural competence will begin. The expression of both srfA and comS represent a different stage of competence regulation. Without srfA, comS cannot be expressed. Without the expression of comS, the transcription and subsequent translation of the cellular components that are needed to accept and integrate exogenous DNA cannot be made. COM-blockers 
Competence can be blocked in S. pneumoniae via the mechanism of COM-blockers which disrupt the proton motive force, which is essential to ATP production. COM-blockers are compounds that inhibit the activity of luciferase, and PROG and TCL - two examples of COM-blockers - decrease the internal pH and thus decrease intracellular potassium levels. PIM does not change internal pH, but does affect the uptake of K+. Benefits 
DNA, consisting of deoxynucleotides, can be a convenient source of nutrition, and if not incorporated into the cell's own genome can provide necessary materials for cell replication. A majority of DNA that a cell uptakes is in fact not incorporated into the genome, but instead broken down and repurposed. Competent cells that more readily absorb environmental DNA, can greatly benefit from this. If successfully transformed, bacteria may gain evolutionary advantages from the incorporated DNA, as mutations and genes causing better survivability can be shared in this way. Absorption of DNA by competent cells can also contribute to DNA repair by creating a template for recombination, which has been specifically observed in Sulfolobus spp. References 

Bacterial genetics
Evolutionary biology terminology