To understand ViewEncapsulation in Angular, first, we should understand the Shadow DOM. You can learn in detail about the Shadow DOM here. Simply put, the Shadow DOM brings Encapsulation to HTML Elements. Using the Shadow DOM, markup, styles, and behaviors are scoped to the element and do not clash with other nodes of the DOM. The Shadow DOM is part of Web Components, which encapsulates styles and login of the element.
Angular Components are made up of three things: