Event delegation is a technique where one event handler is attached to a parent element instead of attaching to each child element.
Simple analogy: Imagine you are an office manager. Instead of going to each employee and personally asking "Are you working today?" (attach handler to each element), you announce over the PA system: "Who is working today? Raise your hand!" and look at everyone at once (one handler on the parent).
How React did it (before version 17): React attached ONE handler to the root document. When you clicked any button:
Advantages:
With React 17+: Delegation happens at the root node (where the app is rendered), not on document. This improves compatibility:
Important: Events that do NOT bubble (focus, blur), React does not delegate — it attaches them directly to elements.