Kathryn H. answered 08/19/24
PhD in Biology with 1.5 years of teaching experience
On average 1/4 comes from each grandparent, but it can vary quite a bit. Ignoring some small exceptions (mitochondrial DNA, x vs y chromosome size, insertion/deletion variants) you get 50% of your DNA from each parent, because the sperm and egg each contribute one copy of each chromosome. Each of your parents is a similar 50/50 mix of your grandparents on that side. It's easy to see where the 1/4 or 25% would come from. If you take one parent's 50/50 mix and take half of it to give you that 50%, you should get 25/25 from those grandparents, right?
Well, as you've suspected, that's not the whole story. The reason is what we call independent assortment. Your parents have one copy of each chromosome from each of their parents and they give one copy on to you, but the copy that is given gets chosen at random for each one. Its like flipping a coin 23 times. You expect on average 1/2 heads 1/2 tails but that's not even possible for an individual set of 23 flips, and your actual results will vary around that 50/50 average.
The law of independent assortment was first described by Gregor Mendel, describing the inheritance of individual traits in his experiments with pea plants. We've since found that it applies most directly to the separation of chromosomes during meiosis, which is the type of cell division that creates egg and sperm (gametes).