Gasoline is commonly referred to as a "fossil fuel" because it is a product of the oil refinement process. Gasoline is mostly composed of chemical compounds called hydrocarbons, which contain only the elements hydrogen (H) and carbon (C).
In an internal combustion engine, gasoline vapor is mixed with air and burned to produce roughly equal volumes of water vapor and carbon dioxide. The hot gases leave the engine through the exhaust manifold and cool on their way through the exhaust system. Some of the water vapor condenses to liquid water while still in the exhaust system. This is what drips out of the tail pipe.
Chemical reactions are never perfect. For gasoline, this means that variable amounts of other gases are generated in the combustion engine and released to the outside air. These are mostly poisonous carbon monoxide (CO) and oxides of nitrogen. Some hydrocarbons remain unburned, while small amounts of elemental carbon (soot) are produced.