I think you have grasped it.
nth-of-x selectors are incredibly generic and usually need additional specificity to make sure they don’t also select other elements.
div.example p:last-of-type example.
Yes, this will target the last paragraph in the div with a class of
example… but it won’t stop there.
It will also target the
<p> in this structure…
<div class="example"> <p></p> <p>Selects this</p> <div class="other"> <p></p> <p>And this</p> /* I'm the last <p> tag that is also a descendant of the example div */ </div> </div>
…because we haven’t been specific enough in the selector.