As much as houseflies irritate us during the day, there is an interesting fact that surrounds them. On a regular basis, we see them bumping and smashing against hard objects such as walls and furniture, etc. but they still manage to escape alive. There are several factors that help houseflies escape uninjured such as the square-cube of law. The square cube of law weighs two factors, mass, and velocity. In simple words, the less the mass, the less are the chances of a thing getting hurt.
Let us take a human and a housefly, for example. A human, as compared to a housefly, features a huge amount of mass. Therefore, if a human happens to come in contact with a wall, or any other hard surface, damage is imminent. In addition to that, the extent of the damage has to do with the velocity as well. If the human crashes at high speed, more damage will be done. However, in the case of a housefly, the mass is very low, and hence if it crashes into a wall even at high speed, it will escape uninjured because its mass will not allow the impact to ricochet. As a result, its major body parts will remain unhurt and will continue to fly.
Scientifically referred to as Arthropods, flies have an armor that is lightweight made of large chitin. The brain, along with the nervous system of the flies, is protected by the exoskeleton. Perhaps the biggest feature flies carry is that they have an open circulatory system, which prevents them from getting hurt or damaged by bruises etc. Open circulatory systems do not consist of blood vessels that are high pressured, instead of a mixture of lymph and blood cells.
A major factor behind house flies not getting hurt when they hit a hard object is their mass. The mass of houseflies is so tiny that it does not hurt them even if they hit a hard object over a thousand times. Once the mass of a creature or any other thing goes up, the gravity is supposed to become more lethal. Since both the mass and size of houseflies are low and small, respectively, the entire body deals with the impact rather than only the physical part that is struck. So, the entire body bounces back, and there is nothing that will bend to cause damage. In simpler words, the amount of mass in flies is so low that their body cannot preserve the momentum needed to push different body parts into places that could hurt it during an impact.
Flies bumping into hard objects and not getting hurt is not only due to their low mass and exoskeleton, but it also has to do with the square-cube law as well. The principle states that when both the size and volume of a creature grows faster as compared to its surface area, that is when things become problematic. In other words, the creature will not be able to support its weight. And, since the weight of a fly is close to being nothing, when it hits a hard object, it escapes unhurt due to less weight being dispersed over a larger surface area. However, if you replace the fly with a horse, it will probably end up dead. Therefore, there is a difference. The more the mass, the higher are the chances of a creature getting hurt as compared to the one that has low or close to zero mass, which escapes unhurt i.e., a fly.