This is a fun one. Unfortunately, Genesis does not preserve the Egyptians' inventory projections for these years. But, in addition to the helpful insights by Dottard, the following are probable contributors:
- Egypt was a regional superpower. We don't have as much data on their agriculture as we do for more recent superpowers, but where we do have data there's a fairly stable trend: superpowers produce more food than they eat. It's very difficult to stay on top of the world if you are dependent on neighboring nations for your next meal (Peloponnesian War, anyone?). At the height of its power, Egypt was almost certainly a net exporter of food. Therefore, 100% output was already more than what was needed to feed the population.
- The first 7 years were years of great plenty, and there's no suggestion at all that people were asked to tighten their belts during the years of plenty--ergo, 80% of the harvest was at least as much (if not quite a bit more) than was necessary to feed Egypt's population plus trading partners.
- In times of famine animals are slaughtered in greater numbers a) because animals are a reliable long-term storage of protein that can be utilized when other sources are unavailable & b) because if there's not enough food for the humans and the animals, the humans get priority (e.g. Shackleton's men eating their dogs). Since the grain would feed humans and animals, as the animal population shrank over the 7 years, the total Egyptian consumption of grain would go down each year.
- Total food production during the famine was not zero, so there would still have been a marginal contribution to the food supply from ongoing production, slowing the rate of inventory depletion.
Grain, if kept dry, can be stored for decades. 7-8 years would present no difficulty for well-stored wheat (source).