In 1901, a Japanese scientist investigating diseases of silkworms discovered that one such disease was caused by a previously unknown kind of bacteria, Bacillus thuringiensis. B. thuringiensis is commonly found in soil where it forms tiny spores which can persist in a dormant state indefinitely.
The strain of Bt bacteria first identified in Japan was capable of killing a variety of butterflies and moths, but only in their larval (caterpillar) stage. The scientific name for butterflies and moths is Lepidoptera.
It took another fifty years before scientists figured out how Bt kills caterpillars. When a caterpillar eats a leaf covered with spores of the bacteria, these spores revive in the insect's gut and begin to grow and reproduce. As a normal part of their life cycle, they produce a crystalline protein, called Cry. Cry molecules have just the right shape to bind to cells lining the insect's gut. Cry kills those cells. Unable to digest its food, the caterpillar soon dies. If an insect has a different kind of gut lining cells, the Cry protein does not affect it. The protein is just digested like any other protein. That's why Cry is highly specific, harming only caterpillars.
As early as 1938, a commercial preparation of spores of B. thuringiensis was sold as an insecticide. It was not terribly effective, for several reasons. Caterpillars often eat only the bottom surface of a leaf but sprayed Bt spores tended to reach only the upper leaf surfaces. There, they were usually washed away by the next rain. But Bt had one huge advantage over stronger insecticides. With insecticides poisonous to humans, the farmer can't harvest the crop for several weeks after the last application. Bt can be used at any time.
Because the Cry protein is produced by a natural bacterium, it is a boon to organic farmers. A rule of the organic movement is that no artificial chemicals may be used, either as fertilizers or as pesticides, but Bt is allowed. (It's not clear just what makes a chemical ``artificial''. Organic farmers are allowed to use mineral oil and on some crops they use copper sulfate, and of course, many chemicals added to food during processing are unambiguously artificial.) But only a small part of the Bt pesticides are used in organic farming. Their largest use is in forestry.
As Bacillus thuringiensis was studied by scientists, many strains were discovered which produced slightly different forms of the Cry protein. Since the different proteins have different molecular shapes, they may fail to bind to the gut cells of one kind of insect but bind to the gut cells of another kind. One strain of Bt produces a Cry protein that kills some beetles, but not caterpillars. Another strain's protein kills a different kind of beetle. There is even a strain whose toxic protein kills mosquitoes. None of these proteins harm birds or mammals.
As we know, proteins are synthesized under the direction of genes, so each of the many different Bt toxins must require its own gene. It turns out that the genes for the Cry proteins are not part of the B. thuringensis' main chromosome. There is a very small DNA molecule called a plasmid, a chromosome with only about a dozen genes, and the Bt toxin genes are found on the plasmid. The different strains of B. thuringiensis have approximately identical chromosomes but slightly different plasmids. Some of the commercial preparations of Bt spores have been genetically engineered to have the genes for several different toxins so they can control both caterpillars and beetles.
There is a deadly variety of Bacillus called anthrax. It is also a spore forming soil bacterium but it can thrive in the blood of many mammals, including humans, and it produces a toxin which is soon fatal. The main chromosome of the anthrax bacteria is essentially identical to the chromosome of B. thuringiensis. Only its plasmid is different. It is only a matter of semantics whether anthrax bacteria are considered a different species or just a different strain of B. thuringiensis.