Even with a background task your app can be terminated by the system without further notice after the suspend event (e.g. when the user powers off the device). There's no orderly fashion in which an app can be terminated and save its data.
An ExtendedExecutionSession with a SavingData reason, should be more than enough for any kind of data.