Brief answer to the question "How does Visual Studio Code recover data after a crash?":
VSCode runs a "Hot exit". In my experience it's pretty reliable. When it runs, it creates a copy of all unsaved files that were open in the tabs of a VSCode window (they call the window an Editor).
VSCode saves these copies in a Backups directory. It also generates a list of paths to the Editors that contained unsaved files.
You can reopen a previously open Editor in VSCode and see your backed up files.
Steps for meeting typical needs
To list the Editors that were open when Hot exit ran
using Terminal on MacOS
cat $HOME/Library/Application\ Support/Code/Backups/workspaces.json`
using Terminal on Linux
cat $HOME/.config/Code/Backups/workspaces.json
using Powershell on Windows
gc %APPDATA%\Code\Backups\workspaces.json
To browse the Backups directory
code $HOME/Library/Application\ Support/Code/Backups/
To Reopen the Editor you want, with the previously open files in the same tab order
code {{ folderUri from workspaces.json }}
Why these steps are useful
I often forget what directories I had opened before VSCode quits/crashes, and the menu to "open recent" from within VSCode doesn't indicate which Editors have unsaved files. For that need the workspaces.json list that VSCode generates seems irreplaceable.
VSCode docs:
Hot Exit
VS Code will remember unsaved changes to files when you exit by default. Hot exit is triggered when the application is closed via File > Exit (Code > Quit on macOS) or when the last window is closed.