"Persistent" here means every version survives, not "saved to disk". set, push and delete return a new version, and anyone holding the old one still sees it unchanged. You get undo, time travel and safe sharing between readers for free.
Copying the whole collection on every update would make that useless at scale, so persistent structures rely on structural sharing. Data is stored as a tree of small, never-mutated nodes. An update uses path copying: it copies only the nodes from the root to the changed leaf and reuses every other node. The cost is the tree's depth times the node width, not the collection size.
The width is what makes it fast. Bagwell's Ideal Hash Trees (2001) describes the hash array mapped trie (HAMT): hash the key, use 5 bits of the hash per level to pick one of 32 branches, and store only present branches in a compact array indexed by a 32-bit bitmap and a population count. The paper presents it as a fast, compact hash table; persistent libraries combine that layout with path copying. With 32-way nodes, a million entries fit in four levels (32⁴ = 1,048,576), so an update copies about four nodes.
JavaScript has no built-in persistent collections; the Records & Tuples proposal was withdrawn. Libraries fill the gap: Immutable.js's README says its Map and List use structural sharing via hash map tries and vector tries.
When it pays off: large collections, frequent updates, and old versions that stay alive. For small state, spread-based copying is simpler and faster to read. That's a judgement call, so measure.