Bt cotton is a transgenic GM crop (genetically modified) which is resistant to pests.
The cry genes from Bacillus thuringiensis are genetically engineered into the genome of the cotton plant to induce the resistance towards the pests.
The cry gene codes for a crystalline toxic protein which remains in the inactive protoxin mode in the plant cells.
Once ingested by the pests, the alkaline pH in their gut activates the toxin.
The active toxin binds to the epithelial cells of the midgut of the insects and creates pores in the gut wall.
The insect stops eating at this point and eventually dies due to starvation.
The pores also allow normal gut bacteria of the insect to invade and cause infection, leading to the death of the insect.