A selector decides which elements a rule touches. Get selectors right and your stylesheet stays short and predictable; get them wrong and you end up fighting the cascade with !important. Selectors combine freely: nav > a.active:not(:hover) chains a combinator, a type, a class and two pseudo-classes. The same syntax drives document.querySelectorAll() in JavaScript (HTML DOM APIs), so everything here pays off twice.
The subsections move from simple selectors to relationships, states and generated boxes, then to the modern tools that control how strongly a selector applies: :is(), :where(), :has(), specificity, nesting, @layer and @scope. Each subsection states the specificity its selectors add, in ID-CLASS-TYPE form (Cascade and Specificity).