Whenever you're ready, walk me through how you'd approach this.
How does the virtual DOM in React optimize rendering, and what are the performance implications of using index keys in lists?
Explain how React compares rendered element trees during reconciliation, separates the render and commit phases, and decides which DOM operations are necessary. Then describe how key values affect component identity when list items are inserted, removed, or reordered, including a concrete example of a bug caused by using array indexes. Keep the answer focused on React for the web and ordinary client-side list rendering.