Shadow DOM isolates selectors, style sheets, etc. It’s about a public/private API for elements.
Contains is about layout and rendering hints to the browser.