Mercaptans are used as an
additive to
natural gas so that it has an odor. In its native state,
natural gas is completely
odorless. This is quite dangerous, however, since if it was supplied to homes in this state, it would absurdly easy to not notice a
gas leak and either
suffocate or
explode (depending on what happened after you failed to notice). So, it is added to natural gas prior to pumping it into homes (it may be added earlier, in the
refining process; I don't know). That way, when you leave the gas on, you smell it!
They are preferred because, as alcohols, they burn quite cleanly and don't leave residue (much).