Foreign genes are segments of DNA that originate outside the native genome of an organism. They can be introduced through gene transfer technologies, which facilitate the incorporation of genetic material from one organism into another. This process is often employed in genetic engineering to confer desired traits, such as resistance to pests or diseases, onto plants, animals, or microorganisms.