Hydrocarbons are organic compounds consisting entirely of hydrogen and carbon atoms, and they are the primary components of fossil fuels like oil, natural gas, and coal. They serve as a crucial energy source and are fundamental in the petrochemical industry for producing plastics, solvents, and other chemicals.