In a CRDT, every operation carries a logical clock tagged with the client that produced it. A state vector is a small map from client ID to the highest clock value that replica has seen from that client. Two state vectors compared side by side tell you, for each client, exactly which operations are missing on which side.
When a peer reconnects after a network drop, it sends its state vector to the server (or to another peer). The other side compares vectors, gathers only the operations that aren't already present, and sends them back as a small binary delta. The full document might be megabytes; the resync is usually a few hundred bytes.
The state vector is also what makes Yjs's offline-first behaviour cheap. A client that's been offline for an hour reconnects, hands over its state vector, and is fully caught up within a single round trip — no full document download, no replay from the start of history. That property is part of why the same protocol works equally well for a two-person pair-programming session and a long-running classroom with students dropping in and out.