Drug discovery involves identifying compounds that can effectively target cancer cells without harming healthy cells. Genetic algorithms can be used to optimize the molecular structure of potential drugs. By encoding molecular properties into a fitness function, GAs can evolve compounds with desirable characteristics, thereby speeding up the process of drug development.