Let us first answer your main question, namely:
Why do I have to export the private view key every time I use my Ledger?
The private view key, if exported to the client (i.e. the Monero software), is stored in RAM until, if I recall correctly, the session ends. A session ending can be defined as the user closing the CLI/GUI with the Ledger Monero wallet, stopping the Ledger Monero app, and unplugging his Ledger device. Therefore, upon reopening the Ledger Monero wallet, the user again has to choose whether to export the private view key or not. Whilst the current design may be perceived as slightly inconvenient, it provides greater flexibility to the user. For instance, a user could let the device perform the wallet scan / refresh if he suspects the system is (currently) unsafe (and thus privacy would be compromised in case of an exported private view key). Note that, as far as I know, it would technically be feasible to permanently export the private view key. The current design, however, does not allow this.
What is saved in the .keys file generated when I create my wallet using the Ledger?
The .keys
file stores some settings related to the Ledger Monero wallet. For instance, if a specific transaction priority level is customly set by the user, it will be stored in the .keys
file.
P.S. Whether to export the private view key or not is predominantly a matter of personal preference, as is explained here:
The Ledger will ask whether you want to export the private view key or not. First and foremost, your funds cannot be compromised with merely the private view key. Exporting the private view key enables the client (on the computer - Monero v0.13.0.4) to scan blocks looking for transactions that belong to your wallet / address. If this option is not utilized, the device (Ledger) will scan blocks, which will be significantly slower. There is, however, one caveat. That is, if your system gets compromised, the adversary will potentially be able to compromise your private view key as well, which is detrimental to privacy. This is virtually impossible when the private view key is not exported.