Here is the puzzle you are sitting with. You are told that between any two rational numbers, however close, there is another rational number in the middle. Take their average — that is the third rational. Between those two there is a fourth. Between those two, a fifth. The rationals are packed onto the number line so tightly that there is no "smallest gap" between them. And yet you are also told that irrational numbers exist on that same line, at points where no rational sits. If the rationals are that dense, how does anything else fit?
The short answer is that density and filling are two different things. Dense means "you can always find another one between any two." Filling means "there is no empty space left anywhere." The rationals are dense but do not fill — there are still infinitely many holes where irrationals live, and the holes are invisible to the kind of zoom that finds more rationals.
Density is a property of pairs
Density says: given any two rationals a < b, there is a rational c with a < c < b. The proof is one line.
The average of two rationals is rational. Why: if a = p/q and b = r/s, then (a+b)/2 = (ps + qr)/(2qs), which is a ratio of integers with nonzero denominator — rational by definition.
So between 0 and 1 there is \tfrac{1}{2}. Between 0 and \tfrac{1}{2} there is \tfrac{1}{4}. Between 0 and \tfrac{1}{4} there is \tfrac{1}{8}. You can keep halving forever and every number you name is rational. That is density.
But notice what density does not say. It does not say "every point on the line is rational." It only talks about what you find when you look between two rationals you already picked. The irrationals are at points you never picked.
Think of the rationals as an infinite sieve
Here is the mental model that unlocks this. Picture the rationals as a sieve — infinitely fine, but made of wires, not solid material. Between any two wires, another wire. Between those, another. The mesh gets finer and finer and finer, but it is still made of discrete wires. Water — the real number line — runs through the holes between the wires.
\sqrt{2} is a drop of water. It falls through the sieve no matter how fine the mesh gets, because it is not sitting on any wire. Wires are at fractions. \sqrt{2} is not at any fraction. The proof that \sqrt{2} is irrational is exactly the proof that no wire passes through that point.
The word "gap" hides a subtlety
When you picture rationals, your eye wants to think of them like dots painted on a line, with tiny invisible spaces between consecutive dots. That intuition is wrong. There are no "consecutive rationals." Between any two, a third. So there are no spaces of positive width between rationals.
And yet there are points not occupied by any rational. How?
Here is the sharpest way to say it. Every rational number has a decimal expansion that either terminates or repeats a fixed block forever. Every irrational has a decimal expansion that never terminates and never falls into a repeating block. Those are two very different kinds of infinite sequence of digits. There are infinitely many decimals that eventually repeat — the rationals — but there are also infinitely many decimals that never do — the irrationals. One pool does not exhaust the other.
You can build an irrational right now. Write the decimal
where the number of zeros between consecutive 1s grows by one each time. This decimal never terminates (it keeps going) and never repeats (the gap between 1s is always growing, so no fixed block of digits could possibly cycle). So it is irrational. And it is a specific point on the number line, just past 0.1, sitting in a gap between rationals like 0.101001 and 0.101002 that your finger will never land on by accident.
Why this matters: you can construct irrationals by writing non-repeating decimals. That means there are at least as many irrationals as there are choices of non-repeating digit sequences — uncountably many, far more than rationals. The sieve has more holes than it has wires.
How many holes, actually?
A later article (hinted at in the parent) makes this exact. But the summary you can take on trust now: the rationals are countable — they can be listed one after another like \tfrac{1}{1}, \tfrac{1}{2}, \tfrac{2}{1}, \tfrac{1}{3}, \tfrac{3}{1}, \tfrac{2}{3}, \dots in some clever enumeration. The irrationals are uncountable — no such list can ever capture all of them.
The consequence: even though the rationals are dense, they are a vanishingly thin scattering inside the reals. If you picked a real number truly at random (by flipping a coin for each decimal digit, say), the probability that it would turn out to be rational is zero. Almost every point on the line is irrational. The sieve has astronomically more holes than wires.
A quick analogy you can hold
Think of the integers as streetlights in a village — spaced one metre apart, all along the road. The rationals are like everyone who walks by on the road all day — there are crowds of them, pressing in, shoulder to shoulder, you can always fit one more person between any two. The irrationals are the road itself. The walkers are on the road, but the road is not the walkers. You could remove every single walker and the road would still be there, silent, unbroken, with gaps between where the walkers used to stand.
Answering the original question
So: how do irrationals fit in if rationals are dense?
They fit in the gaps between wires, not the gaps between dots. The rationals have no positive-width gaps — between any two, a third — but they also do not occupy every point on the line. There is an entirely separate population of points (the irrationals, characterised by non-repeating decimals, or equivalently by not being any ratio of integers) that live on the line alongside the rationals without ever landing on one. Density and completeness are not the same thing, and the real number line needs both — density of the rationals gives you arbitrarily good approximations, and the irrationals give you the exact points that those approximations are closing in on.
Related: Number Systems · Zooming the Number Line: Why Rationals Look Everywhere · Are Irrationals Rare? Actually, They Outnumber the Rationals · Non-Terminating vs Non-Repeating: They Are Not the Same Thing