Natural gas, the fuel in many stoves and heaters, has no smell. The rotten-egg stink is added on purpose, so people smell a leak before a spark can set it off.
Laws requiring it followed a disaster. In 1937, gas leaked unnoticed under a school in New London, Texas. A spark set it off, and about 300 people died, most of them students.
Texas soon required the smell by law, and other places followed.