Several sources can contribute

Browsers provide default styles. Authors add styles for a website, and users may supply their own preferences. The cascade considers where declarations come from and whether they are important. Cascade layers can organize precedence within an origin. These decisions happen before selector specificity resolves otherwise comparable declarations.

Source order is a tie-breaker

The familiar advice that the last rule wins is incomplete. Later appearance matters only after earlier cascade comparisons are tied. A very detailed selector cannot automatically defeat a declaration with higher origin or layer precedence. When a result is surprising, inspect the competing declarations instead of repeatedly making the selector longer.

Follow one property

Hypothetical example: two ordinary rules in the same author layer target the same paragraph, with equal specificity and no scoping difference. One sets its color to blue; the later one sets it to green. Green wins that comparison. Changing the assumptions could change the result. Keeping those assumptions beside an example makes the explanation useful when reading unfamiliar stylesheets.

/* Equal conditions in this example */
p { color: blue; }
p { color: green; }
Hypothetical example: source order decides this otherwise tied comparison.

Further reading: MDN: the CSS cascade.