When an OS reboots or shuts down, it sends all processes SIGTERM before sending SIGKILL. This allows btcwallet to do a proper shutdown which most importantly closes the databases.