Once a file is opened for editing, a copy of the page is generated, the so-called working copy. All modifications during editing are made in the working copy; the new/changed contents is saved on the original page no earlier than upon saving the page and are then directly published.
Whilst the file is in editor mode and the editor window is open, the working copy is kept. The file is blocked for that period of time so that no other editors can work on it.
If the editor window is closed by clicking the close symbol in the browser or if editing is terminated by other means besides the function buttons of the editor, the working copy is kept. The blocking of the file is also kept and no modifications are published. This is why editors should always use the function buttons of the editor.