The back button is not locked to the current app but is based on interaction history. In fact if you use your phone and end up with a dozen open apps, pressing the back button a couple dozen times would be quite similar to navigating in exact reverse of how you got there.
I only know the Android behaviour, what was the difference?