Defendant is presumed to be liable for negligence if he breaks a law and cause harm to the plaintiff but he can rebut that presumption by showing that there was a custom to break the law. This doctrine draws an inference of liability because the thing that caused the accident was in the exclusive control of the defendant. In other words, it couldn't be anyone but the defendant who caused the harm. The defendant caused the harm to occur. There are two different tests you can use.
Railroad guard pushes man who drops package.
Package contains hidden fireworks that explode and cause scales to fall harming plaintiff. The plaintiff must suffer some harm. Plaintiff must not act in a manner that makes damages worse - i.e. not going to the doctor to get well. Defendant is not liable for damages where plaintiff did not mitigate. Even if a defendant is found liable for negligence, he can argue to be relieved of or share liability because of a valid defense.