Gartner Interview Question

How CSS rules are applied to HTML tags. How are the selectors evaluated and actually work.