How does the CSS :has() pseudo-class work?

:has() is a relational selector allowing CSS to apply styles based on the presence of specific child elements.