Once Leader is elected, it starts receiving queries from the clients. Each mutation (or write) query is considered either committed or not committed. What does it mean?
Once a leader applies a write query (Update, Insert, Delete in the SQL world. Basically, any data modification as opposed to ReadOnly queries), it sends the log of it to all the followers, waiting for them to run the same query at their sides. Only if and once it is done transaction is considered committed and a response is sent to the client.
Let's say a leader got a query, sent it to the followers and then went offline without committing it. Then the new leader takes its place, it receives a new query from the client and it results in a query log being diverged between the new leader and the followers which received the query from the old leader. In this case, the new leader considers his log the main one, finds the common place in both logs, and rewrites every piece of the log at the follower's log with its own data. The next replication entry will already be coherent across the cluster.