If you remember biology class, you probably know what Mendel had landed on: Traits are controlled by genes, and individual genes come in different flavors known as alleles. Since you get one copy of each gene from either parent, you can end up with two different alleles of the same gene.
A pea plant could have a copy of the height gene that coded for "tall" and a copy of the same gene that coded for "short." But the tall allele is "dominant," meaning that a tall-short allele combination would result in a tall plant. If two tall plants that both carried short alleles (the "recessive" version of that trait) got together and produced a new generation, as our Punnett squares taught us, roughly 25 percent of their offspring would get a short allele from each parent and end up actually being short.
But you raise an excellent point: Why do some alleles trump the instructions carried by others?
That question does not actually have a single, simple answer, because genetics gets way more complicated than pea heights. Many traits — eye color, for example — are influenced by many genes. And many different alleles will produce the same proteins, resulting in the same physical outcome even if you didn't get the same particular set of genes from mom and dad. So it's not as if everything about you can be calculated simply with a Punnett square.
When we talk about genes being dominant or recessive, we're generally talking about traits controlled by the amount of a certain protein produced. Science communicator Joe Hanson helpfully describes this as a matter of "dosage": A dominant gene will often produce enough of its related protein to result in its signature trait, even if it has to do all the legwork on its own. So when it's paired with the recessive allele — which doesn't signal the body to produce the protein — the physical result is the same as if it were paired with another dominant one. With two recessive alleles, however, the body is only getting a low dose or no dose of the protein.
Eye color is a good example in humans: If the genes that control melanin pigment production in the eye are of the turned-off variety, you'll have pigment-less blue irises — eyes that refract light just like the colorless sky, producing the appearance of blue tones. Several genes influence eye color, and that's why the results aren't as simple as "brown" and "blue" — but that dosage question is a big determining factor, which is why we often see eye color presented as a simple Mendelian trait.
But even these "basic" genetic equations can get complicated, and some dominant traits work a little differently. If genes are controlling a process where all of the alleles need to be on the same page in terms of protein production, the dominant gene will be the one that's broken. Here's a great analogy from a Reddit user: If genes are churning out bricks and one allele produces building blocks shaped like baseballs because of a missing protein, it doesn't matter how many solid, rectangular building blocks your other alleles give you — that wall isn't going to stay up. So in this case, the allele that gives a low or tainted protein dosage is considered the dominant one. You only need one copy of it to get the associated trait.
In case you don't get just how complicated this stuff is, consider sickle-cell anemia. People with two copies of the sickle-cell allele end up with malformed red blood cells, causing painful and life-threatening health problems. People with just one copy of the allele have some malformed red blood cells, but the healthy cells can usually maintain normal body functions.
If you think of the "trait" here as whether or not you have sickle-cell anemia, then the allele for sickle cell is recessive. You need two copies to make you sick. But this does not work the same as brown eyes: The body is not making enough of the healthy proteins to cover up the bad allele's effects in every blood cell. Instead, it's producing enough healthy blood cells to carry the burden of the misshapen ones. So really, this is an example of co-dominance — like a color-coding allele combining with a low-dose variant to produce a pink flower instead of a red one.
All of this is to say that "dominant" and "recessive" are very simple words used to describe a very complicated process — one wilder than Mendel ever imagined.