The cascade is an algorithm that defines how user agents combine property values originating from different sources
The cascade defines the origin and layer that takes precedence when declarations in more than one origin, cascade layer, or @scope block set a value for a property on an element
CSS declarations come from different origin types:
User Agent Stylesheet
Author Stylesheet (added by developer)
User Stylesheet
added by user, chrome does not allow, and it is being phased out
extensions can still do it
Cascading algorithm:
find all the CSS rules applying for a given element
sort rules based on Origin (and other parameters like !important, cascade layer etc.)
In general: User Agent > User > Author
If same origin, Specificity of rules are considered
If same specificity, Scoping Proximity is calculated
If same Scoping Proximity, Last declaration of rule is considered