React uses element type and position within the parent, with keys identifying children among their siblings. Stable item IDs preserve state with an item across reordering. Index keys can attach local state to the wrong item after insertion or sorting. Changing a key intentionally resets that subtree.
Follow-up Interview Question · Give a case where a changing key is the right way to reset a form.