First, let’s get something out of the way: comet C/2019 Y4 (sometimes called ATLAS after the telescopes that found it) is not “half the size of the sun.” The comet’s actual nucleus – the lump of ice – is only a few kilometers across. Don’t be fooled by scary headlines thinking a mega-giant ball of ice is plowing through the solar system.
When a comet gets close to the sun and warms up, the ice evaporates into a cloud (called a coma) that can be thousands of kilometers across that is blown into a Comet tail tens of millions of kilometers long. Those are larger than the sun’s diameter and completely normal for comets. They’re vacuum-thin gas and dust that won’t hurt Earth.



Anyway, back to the question: Why didn’t NASA notice?
Reason 1: Asteroid Terrestrial-impact Last Alert System (ATLAS) is operated by the University of Hawaii, not NASA, so that’s sort of an unfair question. NASA wasn’t looking. It was paying UH to look.
Reason 2: ATLAS didn’t spot comet C/2019 Y4 until December of 2019 because comet nuclei are very dark, carbon-rich nuggets, like this black potato that is Halley’s Comet’s nucleus. They’re hard to see until they start flaring up in the heat of the sun close to the sun.

Reason 3: Comets like C/2019 Y4 are on very elongated orbits. C/2019 Y4 goes from 0.25 astronomical units (AU, the distance from the sun to the Earth) to 662 AU. In other words, it sweeps in from sixteen times as far out as Pluto to inside Mercury’s orbit. Comet C/2019 Y4’s orbit looks something like this:

The thing about those orbits is that as a comet moves farther from the sun it slows down, way down, until it’s almost stationary. It takes over 6,000 years for C/2019 Y4 to finish one orbit, and most of it is spent at the far end, very far from the sun.
But as a comet begins to fall back toward the sun it picks up speed, a lot of speed. It goes zipping past the sun far faster than planets in boring circular orbits.
(Hitchhikers seen on comet C/2019 Y4 as it makes its closest approach to the sun.)
This high speed near the sun means that the dark, icy potato that’s C/2019 Y4 only appeared close enough to Earth to be noticed very recently. Like, December 2019, when it was still an icy, small, black lump of ice.
Finally, because it only got near the sun very recently, C/2019 Y4 hadn’t begun to generate a coma and tail that were “half the size of the sun.” It was a small, dark, cold target.