When an object of type file is double clicked in WebClient, it either triggers an editing action or, if the file doesn't have an editor associated, it triggers a file download.
CB can edit textual files directly in the browser: .txt, .html, .xml etc. (You can "edit as text" any file).
Office files (.doc, .xls) are opened via WebDAV links, see WebDAV.
When a file is saved, it's previous version will be kept if configured so (see File versioning).