An error boundary catches errors during rendering, lifecycle methods, and constructors in the child tree below it, then renders fallback UI.