Petroleum is a naturally occurring substance found in underground rock formations. Its composition varies from one source to another because petroleum is a mixture of many different hydrocarbons and other organic compounds, not a single pure substance.
A pure substance (element or compound) has a fixed, definite composition regardless of its source. A mixture, however, consists of two or more substances combined in no fixed ratio, so its composition can differ from sample to sample.
Petroleum contains alkanes, cycloalkanes, aromatic hydrocarbons, and other compounds in varying proportions depending on the geological conditions under which it formed. This variable composition is precisely what defines it as a mixture and is why it must be separated into useful fractions by fractional distillation.
While petroleum is indeed a hydrocarbon-containing substance, a liquid, and a natural resource, none of those properties explain why its composition varies. Only the fact that it is a mixture accounts for this variability.