Last week’s 7.2-magnitude Good Friday earthquake in Mexico City sent people scurrying out into the streets as chandeliers and other objects spun wildly in houses. The quake wasn’t Earth’s biggest Good Friday temblor (that was the Great Alaskan Earthquake of 1964), nor was it the biggest to hit on an April 18th (that was the Great 1906 San Francisco Earthquake). In some ways, however, it was more unusual than either of those, because Mexico City’s earthquakes are unique. Unlike other shaky cities, such as San Francisco or Tokyo, Mexico City is nowhere near a major fault. The nearest one is 200 miles away on the coast. Still, Mexico’s unusual rock and soil allow its residents to experience potentially powerful shaking. And while this has led to catastrophic events, it also provides unique opportunities to study earthquakes and prepare for the future.

By all reasonable expectations, the force of such distant earthquakes should peter out long before they hit the city. But Mexico City—which in Aztec times was actually a small island in the middle of a sprawling lake—is mostly landfill and loose sediment. Such sediment amplifies tiny tremors the same way a cup amplifies the sound of a voice traveling along a string.

“Seismic waves are just sound waves in the ground,” says Vala Hjörleifsdóttir, a seismologist at National Autonomous University of Mexico. Nowhere in the world is the amplification of earthquakes so extreme as in Mexico City. Thanks to pliable bedrock and landfill that is often described as Jell-O shaking in a bowl, Mexico City amplifies earthquakes many times their strength when they arrive. Thus, even the withered remnants of a distant quake can make for a troubling morning.

But more interesting is the type of shaking that happens. Just as a pair of earmuffs can block the sound coming into your ears or sunglasses can screen out certain types of light, the soil under Mexico City only allows certain vibrations to reach the city.

For instance, vibrations in the city center occur in intervals of about 2.5 seconds, depending on the depth of loose soil. This frequency contrast starkly to seismic vibrations in most places on Earth, where quake vibrations are faster, more chaotic and less predictable.

This specific frequency of shaking can spell disaster for certain buildings. If earthquakes here are like vibrating string and the soil is like a cup amplifying noise, then buildings are like tuning forks. Certain buildings—usually those reaching up eight to 20 stories—resonate at the same frequency of the quake and, like ocean waves piling up on each other, crescendo into an even worse shaking.

“You have like a double amplification,” says Eduardo Miranda, a civil engineering professor at Stanford who grew up in Mexico City and specializes in designing for earthquakes. “One is from the rock at the very bottom of Mexico City that gets amplified to the surface. Then it has buildings of certain heights on top of this soft soil that further amplify it.”

This is what happened in 1985 when buildings in the central part of the city crumbled and killed at least 6000 people. Overwhelmingly, the buildings that suffered the most damage fell into the height range that best resonated with the shaking soil. Buildings that were shorter or taller than that range survived far better.

Before 1985 scientists vaguely understood these concepts, but after that catastrophe they focused their energies on Mexican tectonics. Today scientists understand the dynamics of the city far better and have designed buildings accordingly. For instance, many buildings here now have odd grid-like steel braces running up one side. Most people assume these are to help hold the structure up, but in fact, they are meant to disrupt the shaking so that the building is stiffer and no longer shakes at the same speed as the quake.

“There are two things you can do,” Miranda says. “One is to try to avoid this height. Or, if you have to make buildings that height, you make them a lot more rigid.”

Last Friday’s quake, however, was only about a tenth the strength of the 1985 quake. And seismologists think a stronger quake is coming. Like the 1985 quake (and most damaging earthquakes here), the April 18 quake originated on the coast near Acapulco. It started when about 20 miles of the fault ripped at once and shifted. But scientists say that as much as 250 miles of the fault could shift at once, generating a huge quake. Scientists have been especially focused on one region called the Guerrero Gap, which they say has not been moving enough and may be building up a massive amount of energy waiting to be released.

Friday’s quake released some of that pressure but not nearly enough.

“If it is accumulating energy, eventually it has to break. And that’s the spot that hasn’t broken,” says Hjörleifsdóttir, who studies the fault.

Scientists can’t be sure exactly how much of a threat the Guerrero Gap poses to the hemisphere’s largest city. But they can begin to prepare. Earthquakes travel fast—about eight times the speed of sound. But electricity travels a lot faster. Less than ten seconds after the fault ripped on Friday, the government and the media in Mexico City received an alarm from the Mexican Seismic Alert System (SASMEX), which has been tracking earthquakes and issuing warnings since 1991. Because the waves of the earthquake had to travel so far, residents who got the warning had a full 80 seconds to exit their buildings and gather on the streets (One brave broadcaster opted to stay inside the studio and continued to report). Japan has a similar system in operation and California has tried for a decade to create its own (a new state law recently provided money for it). But because of Mexico City’s distance from its threatening fault, no other city offers as much of an opportunity for warnings. The signal on April 18 went out to 60,000 classrooms and the subway shut down before the quake arrived (and was running again just three minutes later). “It was a complete success,” says Juan Manuel Espinosa-Aranda, general director of SASMEX.

This last quake did not live up to the level of other historic April quakes. But scientists say the bigger quake is coming. They know where it will come from and exactly at what frequency it will shake in Mexico City. They’ll even have more than a minute’s warning. All that remains is to get ready.