Extreme Hereditary Murphy's Law, also abbreviated to EHML, and simply referred to as Murphy's Law in the show, is a condition that affects male members of the Murphy family, such as Milo and his father, Martin. The condition influences the negative probabilities of certain circumstances around the affected member, increasing the chances for it to actually happen, as how the term "Murphy's Law" was coined by Edward Murphy: "anything that can go wrong, will go wrong".
Murphy's Law has been passed down through the Murphy family tree since Sheriff Murphy, the original Murphy's Law from 1875.
Murphy's Law is a condition which affects the Murphy family, as well as the main premise of Milo Murphy's Law. The basic idea of the hereditary disease is simple: it causes continuous catastrophes among members of the Murphy family. The idea of "bad luck" as seen in the series leads to destructive events. Murphy's Law has extreme social consequences on whoever has it: most people familiar with the effects of the law will stay away from the afflicted. The Murphys find that the best way to deal with their condition is to approach life with a positive and optimistic attitude.
The Murphy's Law "gene" was transmitted for generations until Milo finally received it. EHML only affects males, so Sara Murphy, Milo's older sister, is unaffected by it. The pattern of those effected by Murphy's Law seem to indicate that it's a Y chromosome linked gene.
Milo's EHML results in a cyclone of calamities which follows him wherever he goes. They can be as small as just slipping or as large as entire buildings being destroyed, things catching fire without reason, trucks exploding, etc.
Murphy's Law is unpredictable. The severity of consequences cannot be judged by simply considering the severity of things that have happened before; there is no rhyme or reason to when someone affected will encounter disasters. Therefore, there is no way to "plan" for Murphy's Law except to prepare for any eventuality. But being affected by Murphy's Law does not negate the possibility of good luck occurring, which is part of the unpredictability of EHML.
When Baljeet investigates Murphy's Law in "The Phineas and Ferb Effect", he describes it as a fundamental law of nature, in which the affected expel negative probability ions. He also notes that Phineas and Ferb have a similar affliction, which expels positive probability ions, meaning that they're more likely to experience good luck. He dubs this the Phineas and Ferb Effect.
According to Baljeet's research, the negative probability ions from Murphy's Law are unable to occupy the same space as the Phineas and Ferb Effect's positive probability ions. If someone afflicted by Murphy's Law is surrounded by people with the Phineas and Ferb Effect, the negative probability ions are pushed away from the positive probability ions, like two identical magnet poles. This phenomenon can be used to aim Murphy's Law elsewhere if desired.
As shown in "Cast Party", Murphy's Law is able to create a domino effect, and everything can go wrong, even though Murphy's aren't nearby.
As shown in "First Impressions", Murphy's Law can manifest before a Murphy is even born, as shown in a flashback before Brigette went into labor.
Edward Murphy is credited with coining Murphy's law in our world — the principle that the worst thing can and will happen, and at the worst possible time. However, as Edward Murphy was born in 1918 and died in 1990, he is not the "original Murphy" in the Milo Murphy's Law universe. Milo claims that the original Murphy is his great-great-great-great-grandfather.
In Milo Murphy's Law
The original Murphy of Murphy's Law was the sheriff of an Old West town that was populated entirely by stranded time-travelers. His EHML had caused all their time machines to break down there. Cavendish and Dakota even landed there, but they returned to Milo's present by bump-starting their time machine. ("The Race")