RBC Interview Question

What is the reason for the shadow DOM in front-end frameworks like React?