The virtual DOM is a lightweight, in‑memory representation of the real Document Object Model used by libraries such as React. It enables the framework to work out the smallest set of changes required and then apply those updates to the actual DOM, improving performance and simplifying UI code.