How is revision works internally?

How is revision works internally?