Episode 1 of “The Last of Us” opens with Sarah making breakfast for Joel, saying that they would have to settle for eggs instead of birthday pancakes, as they’re out of pancake mix. While this little moment seems innocuous at first, the episode steadily lingers on a string of events that hint at why Joel and Sarah do not get infected. Then on, the Adlers offer the duo freshly-baked biscuits — which the elderly Mrs. Adler is seen eating in that scene — but Joel refuses as he claims he’s on the Atkins diet. Later, Sarah does not ingest the cookies she helps the Adlers make, as they have raisins in them, while Joel forgets the birthday cake that he had promised to his daughter when he gets home.
In all of these instances, flour is the key ingredient used in all of these foodstuffs, which Joel and Sarah do not ingest, either by choice or a stroke of luck. Episode 2 expands on this idea by situating the origins of the outbreak in Jakarta, Indonesia, wherein the first reported cases of the infected are factory workers who worked in flour mills. Moreover, mycologist Ibu Ratna (Christine Hakim) pointedly notes that flour is a “perfect substrate” for the fungal outbreak, as it is the ideal carrier for accelerated mass infection.
Keeping this key information in mind, the events of the prologue make perfect sense. As the duo luckily ran out of pancake mix, did not ingest any cookies/biscuits, and Joel forgot to get a birthday cake, they managed to not get infected via foodstuffs with contaminated flour. As Mrs. Adler was strictly eating biscuits all day, she was the first to get infected, and hence passed it on rather viciously to the rest of her family. (It should be noted that the showrunners have directly addressed and confirmed all of this, too.)