Your data is encrypted by default in Android 9, it has nothing to do with Knox. What happens is when you first use your phone it generates an encryption key which it stores safely and uses that to encrypt.decrypt your data, This key is used until you do a Factory reset. Following that, a new encryption key is generated. this means that any files encrypted by the old key are now unreadable. Before doing a Factory reset, you must back up all data that you want to keep, either to a removable SD card or a cloud service e.g. Google Drive/ Photos etc.