A question about Badger Transaction

How badger guarantees the atomicity of transactions?

What if the method writeRequests crashes while writing, how do i konw those written data is acutlly not committed?