They write blocks of data to holes in the file or at the end of the file, and if the transaction is committed they then change pointers in the tablespace to the new data, else if rollback they leave the pointers at the old data locations.
-Waswas
Comment on Re^3: Writing to a file atomically without renaming