The Virtual DOM works in three steps:
Step 1: Whenever any data in the React App changes, the entire UI is re-rendered in the Virtual DOM representation.
Step 2: Calculate the difference between the previous DOM representation and the new DOM.
Step 3: Once the computation is done, the real DOM updates only those things that were changed.