If an app goes to the background it isn't necessarily killed. It's only killed if the system decides to do this. The usual explanation would be due to memory pressure, but the OS can do what it likes. If your app has started a background task it will continue to run until the timeout. Then it will be backgrounded but not killed. An app may stay in the background for weeks without being killed.
If you want your app to restart in the same state it was in when it went to the background, regardless of whether the app was simply backgrounded or was killed, then it is up to your app's code to do this. Apple provides some capability to do this but usually you have to do something specific for your app to make this work.