Explain React’s reconciliation and diffing algorithm.

React’s diffing algorithm compares virtual DOM trees, updating only the changed nodes to optimize DOM updates.