When you write to the primary, the change is recorded in a log before anything else happens. PostgreSQL calls this the Write-Ahead Log (WAL), MySQL calls it the binary log (binlog). The primary streams this log to each replica, which replays the same operations to stay in sync.
Most setups use asynchronous replication: the primary confirms a write to the application immediately, then sends it to the replicas a moment later. This keeps writes fast, but it creates replication lag. A replica might be 50 milliseconds behind, or several seconds behind under heavy load. During that window a read from the replica returns stale data.
This causes the classic read-your-own-writes problem. A user updates their profile (write goes to primary), the page reloads (read goes to a replica that has not caught up), and they see their old data. The fix is to route reads that must be fresh, like reading right after a write, straight to the primary, and send everything else to replicas.
Synchronous replication exists too: the primary waits for at least one replica to confirm before acking the write. This eliminates data loss on failover but slows down every write, so most systems reserve it for one critical standby and keep the rest async.