Clive Feather gave a good explanation of this some time ago on this group.
RFC 3482 gives a thorough, somewhat numbing, overview of number portability:
http://www.ietf.org/rfc/rfc3482.txt
The right way to do it is to look up each number when the call is
placed to find out where to deliver it. The wrong way is to implement
it as a variety of call forwarding. As of 2003 when the RFC was
written, the UK did it mostly the wrong way, with some BT switches
doing it closer to the right way. A quick look at the OFCOM site
suggests nothing much has changed since then.
UK portability will always be inferior to North American portability,
since it doesn't permit porting between landline and mobile, but there
isn't much to be done about that.
R's,
John