When you dial a number, you generally look up the owner of the number range in a list, then initiate signalling contact with them. They may take the incoming messages, or they may point you towards another network the user can be reached on (i.e. if they have ported their number)
In essence, in the regulated telecoms space, the number block owner retains responsibility for routing to the new network after a number port.