Time. Crucial in order to be sufficiently prepared to meet the onslaught.
And time can be bought by being forewarned of the assault, slowing the assault, barring the assaulters from getting close enough to do damage.
Strange, how few people "out there" in the general population think it through. Of course, many simply cannot afford (or don't make the effort to afford) basic changes that can help "buy" time in these ways. Simple use of technology can help. Having a dog helps many. Putting in security-grade doors help. Having a safe (or at least safer) area of the home can help, ie by having a barred entry hallway or doorway to the sleeping area(s). Ensuring we have our communications nearby, our defensive tools nearby. Ensuring we don't sleep in utterly unprotected zones of the house (like right next to the unsecured front door). Ensuring we don't sleep utterly unarmed and incapable of quickly getting to our defensive tools.
Lots of little improvements can be had all over the place. Most of us have considered many of these things and implemented as many as make sense and can be afforded. Most of us appreciate the basic risks of failure in these key areas.
In this case, the folks are lucky. There were four assailants; they were armed; they worked in concert, and aggressively; they failed to press the issue, when confronted despite their weaponry. Could easily have turned into a multi-murder scene, had they just had a bit more gumption. Apparently, didn't speak English, either, which would have complicated certain aspects. Although .357mag, 9mm and .45ACP is spoken everywhere, in that regard.