A CRDT is a data structure designed so that two replicas, edited independently, can be merged without coordination and without losing information. The merge is associative, commutative, and idempotent, which means it doesn't matter what order updates arrive in, whether they arrive more than once, or whether they were applied while a participant was offline.
In a collaborative editor, the practical payoff is that two people can type into the same line at the same time and the result is always a single, consistent document on every screen — no central server has to arbitrate edits, and no edits get silently dropped during a network partition.
CRDTs come in two broad styles: state-based (CvRDTs), where replicas exchange their full state and merge by taking a least-upper-bound, and operation-based (CmRDTs), where replicas broadcast operations and apply them deterministically. Yjs, the library ShareCode uses, is an operation-based CRDT specialised for text and rich content.
The trade-off is metadata growth: every character ever inserted needs a stable, sortable identifier so it can be ordered correctly even after deletions. That metadata is what tombstone garbage collection and state vectors exist to manage.