Sorry if this is too elementary a question...
It's a good question!
How and why does new / more complex genetic material arise in evolution? For instance, the flight gene(s) in birds.
I’m going to pre-empt a lot of replies here. Usually when someone asks this question on an internet science forum there is a stampede of people who will rush to talk about mutation and natural selection. Whilst it is true that these processes produce DNA variation and new allelic combinations, they act on
existing DNA. They do not produce
new DNA. So where does new material come from on which mutation and natural selection can act?
New material comes from a couple of difference sources. The primary source is the accidental duplication of DNA. Sometimes cells make mistakes when copying their DNA during cell division, and sometimes these mistakes happen during early embryonic development resulting in an organism carrying the mistake in all its cells. There can be duplications of portions of genes, whole gene duplication, partial chromosome duplication, whole chromosome duplication, partial genome duplication, or whole genome duplication. All these events create new DNA on which mutation and natural selection can act.
When whole genes and chromosomes are duplicated they are not functionally constrained and are free to accumulate mutations that, over time, turn them into new genes with new functions. As you can probably imagine, when whole genomes are duplicated there is a tremendous amount of new material that is created. Much of it is lost over time, but the remaining duplicated material is re-shaped into new genes. This has happened in many plant and animal lineages at various times over the course of the evolution of life on this planet.
This duplication in genetic material is demonstrated by the fact that more complex multicellular organisms (eg. humans) have gene families. In other words, “simpler” organisms (such as the extensively-studied fruit fly
Drosophila melanogaster and round worm
Caenorhabditis elegans) have single copies of genes, whereas those same genes are present in complex organisms as gene families – several related genes with similar overall features but also with differences that impart differing functions that are applied in different cells/tissues at different stages of development.
There are other sources of new genetic material. DNA repair mechanisms sometimes make mistakes that result in insertions of new DNA at the site of repair. Transposable elements have had a large impact in the shaping of plant and animal genomes. They move around the genome and sometimes copy and insert host DNA in the process of moving around between chromosomes.