When you produce sex cells, you body splits the code randomly. The cell might contain the first copy for hair color, but the 2nd copy for eye color. This happens in both the sperm and eggs.
Then when they combine you have a full set of genetic data again, but it’s a random selection of 50% of you DNA.
The fun part is that the code itself determines which copy is dominant. Your offspring has a copy of your eye color data, and your wife’s.
Added on that is that the two copies combine to produce the outcome. Depending on the code, the dad’s copy might dominate, or the mother’s, or the both of them can produce yet a 3rd outcome.