Apple’s original model for loading purchased music onto an iPod was that you sync it in one direction. That would be from a master library on a computer to an iPod. Get a new iPod - there was no way to copy music from the old iPod to the new one. Instead, you’d sync the new one against your computer.
i believe that when you upgrade from one iPhone to another, similar rules apply. Restoring a backup or using Quick Start does not transfer music. Instead you must re-sync (manually against a computer, using iTunes Match, or using Sync Library with an Apple Music subscription), or re-download iTunes purchases (free of charge) to the new device. Manual synchronization of purchased music does not require a subscription, but you do want to take care to keep the master music library on your computer intact.