How does Sync Gateway work under the hood?

Out of curiosity, I’ve been reading about formal approaches to data syncing. The big players I found out about are Operational Transforms and Conflict-free Resolution Data Types.

Does Sync Gateway use either of these as its underlying theory? Or is there something else?

Here is an overview - Data Replication 2.0. The blog is bit dated and the protocol has evolved since but the high level concepts still apply. You can also checkout the wiki pages on our sync gateway GitHub repo.