When the search space is extremely large, trying every possible solution can be a nightmare.
To address this, in the 1960s, a computer scientist named John Holland borrowed an idea from Darwin's theory of evolution and introduced the Genetic Algorithm. Instead of calculating the optimal answer directly, this algorithm starts from a population of random candidate solutions and gradually improves them through selection, crossover, and mutation. The result is an adaptive search algorithm capable of finding strong solutions to global optimization problems.

Source: https://www.generativedesign.org/02-deeper-dive/02-04_genetic-algorithms/02-04-01_what-is-a-genetic-algorithm
Instead of directly calculating the final optimal solution, GA:
To map biology onto code: