Electrical systems are just like cars:
New cars contain the latest safety systems, older cars do not. (Does that antique Chevy have safety glass, seat belts, padded dash, or anti-lock brakes?)
The newest homes have electrical systems with shock protections, arc (spark) protections, lightning protections, grounding systems, and better insulated wire (that doesn't crack open and expose the live metal). If your home is 5 or more years old, you are probably missing one or more of these important safety features.
Cars deteriorate from use and require periodic maintenance. (Would you drive with bald tires, gas leaks, bad brakes, or broken steering?)
Older homes have electrical connections that have loosened over time due to continuous expansion and contraction of the wires. (They heat up when electric flows and cool when it's off.) Loose connections create dangerous fire producing arcs. Receptacles may break from use exposing dangerous live metal parts. Circuit breakers are mechanical parts which age and may fail to operate in an emergency allowing a fire to happen. Older wire develops cracked insulation.
Age and usage are the major factors, but new homes are not immune since they can suffer from poor workmanship. (Most homes were wired by the lowest bidder.)
The whole system deteriorates with use, misuse, and environmental conditions and requires maintenance to stay safe. Unfortunately, most of your electrical system is hidden inside your walls, so this deterioration is not obvious until something bad happens, like a fire or electrocution.