Shadow DOM allows encapsulation of styles and markup within a shadow root attached to a host element. Styles and selectors stop at the shadow boundary, but inherited values and custom properties pass through. Slots display host children in the shadow tree, parts expose specific elements for external styling, and declarative shadow DOM enables server-rendered components.