Start here. This is the direct spoken answer to practice first.
Overview
A boundary should contain an unexpected failure without turning every expected product outcome into an exception.
An error.tsx file creates a client error boundary for the route segment below it, so an uncaught rendering failure can show a fallback while parent layouts remain available. The error bubbles to the nearest matching parent boundary if the local one cannot handle it. A root global-error.tsx replaces the root layout and must render its own html and body elements.