A realized sequence is a chain of objects in memory, with each link in the chain pointing to a value and to the next link until you eventually get to a function object which is the remaining unrealized portion of the sequence. References to any link in the realized chain cause the rest of the chain from that point forward to be strongly held and unable to be gc'ed.
If you are only pointing to the unrealized "end" of the chain, then all of the links "behind" you can be collected. When you "hold the head", that pointer is to the beginning of the chain, which prevents the N links from beginning to the unrealized point to be held in memory.
For example:
(def r (repeat 100000000 "abcdef")) ;; r holds a strong reference to the head
(count r)
vs
(count (repeat 100000000 "abcdef"))
which can walk the seq, allowing the links behind the counter to be gc'ed. (Note that range
is a typical thing people use for these kinds of examples, but it has an optimized count
for the typical cases.)