It's not just "dirty" in the sense of having a lot of suspended crud, although that is part of it.
Over time, a number of things happen to oil in engines- the additives get depleted due to various chemical goings-on within the engine, the oil itself changes grade (usually gets thicker), crud gets suspended, the oil can be diluted due to excess fuel blow-by, and so on. Different fuel types and engine types cause these sorts of things to occur in different proportions and at different rates, so diesels, gasoline engines and gaseous fueled engines all have different oil requirements.
The cumulative effects of all these things adds up to a need to change out the oil periodically, in order to keep the additives fresh, the oil in grade, and remove all the suspended crud. That varies by the fuel type and the usage- short-trip gasoline engines are going to have a very different change requirement than a stationary natural gas generator, for example.
And yes, oil type/brand plays into that- oils vary in their ability to resist grade changes, oxidation, additive depletion, crud suspension ability, and so on, and some are rated for longer changes or different fuel types than others. So that's why some are rated for 5k, and others for 20k, or why some meet certain specs and not others, etc...