It "just works" if you fully buy into the ecosystem. i.e. all content stored in iCloud nothing synced via cable etc.
I happen to do this since i tend to need a new iPhone every 2-4 months and it's just easier to pick up a new one, sign in and let it set itself up exactly as the old one.
But anything that deviates from this workflow, you tend to run into problems.