On Tuesday, Iran launched more than a dozen missiles targeting two Iraqi military bases housing American soldiers. The attack was retaliation for the US drone strike that killed Qasem Soleimani, a top-ranking Iranian military general. In a televised speech on Wednesday, President Donald Trump said “minimal damage was sustained” during the attack and that no American or Iraqi lives were lost. Considering that Iran has developed missiles that are accurate to within a few tens of meters, it’s remarkable that all personnel at the base emerged unscathed.

According to Trump, this had nothing to do with luck or bad aim. Instead, he attributed it to “an early warning system that worked very well.” The US has a vast network of radars and satellites dedicated to tracking missile launches around the globe, which allowed troops stationed at the Iraqi bases to take cover before the missiles struck their targets. The system worked as intended, but as the missile technology of America’s adversaries continues to improve, some experts wonder if the country’s first line of defense will be able to keep up.

America’s missile warning system harkens back to the early days of the Cold War, when the threat of a Soviet nuclear attack kept the world on edge. By the early 1960s, the US had a network of a dozen ground-based radars concentrated around the Arctic and several infrared satellites capable of detecting the launches of Russian intercontinental ballistic missiles that could deliver a nuclear warhead to the US mainland. The ground-based radars would constantly send pulses of high-frequency radio waves toward the horizon; if a missile was launched, the radio waves would be reflected off the missile back to the radar antenna, while the satellites would search for heat signatures from the missiles.

Although the fundamental methods for detecting a missile launch haven’t changed all that much in the past 50 years, today’s missile warning systems are vastly more accurate and responsive. One of the biggest improvements in early warning technology has been seen in space systems, which keep a constant watch for missile launches across the entire globe. At present, the US has four missile-tracking infrared satellites in geosynchronous orbits—meaning they never change position relative to the surface of the Earth—and two additional infrared missile detection systems likely hosted on classified National Reconnaissance Office satellites. In the case of the Iranian attack, it was almost certainly one of these satellites that gave the military a heads-up that missiles were on their way.

“It must have been space-based or a manned aircraft,” says Riki Ellison, founder and chair of the nonprofit Missile Defense Advocacy Alliance. “Radars are limited by the horizon and mountains so you won’t be able to detect a missile until it clears a certain elevation. You need something directly overhead.”

Once a satellite detects a possible missile launch, it triggers an alert at the Missile Warning Center, run by the US Space Command out of the Cheyenne Mountain Air Force Station in Colorado. There, military analysts work to confirm that the detection is legit and process the trajectory of the missile to determine where it will strike. With this information in hand, Space Command can determine whether a missile intercept is possible or necessary. How long the whole process takes, from detection to direction, depends on the launch location and target. In the case of the Iranian attack, US officials say troops had hours of advance warning of an impending attack from communication and signals intelligence, but the warning after the missile launch was likely only a few minutes. No attempt was made to intercept the missile; instead, troops at the targeted bases were ordered to disperse.