A good example of such a crop is GM cotton,which is often grown in the United States for cottonseed oil.
If a crop can kill pests, the farmer does not have to spray so often to kill pests.
An example of a pests-resistant crop is maize, which is similar to corn.