TS: The CTA receives a list of available TS's, and it will register with whatever one it desires. This can be forced by using the Manyullay Assigned Agent option either at the Site or Site Server level, within the Site Maintence UI.
PS: SMP checks to see if there is a PS in same subnet as client, and if there is, it will provide that PS's codebases. If there isnt, it will check to see if there is a PS in same site as client, and if there is, it will provide that PS's codebases. If there isn't, it will provide its own codebases, if configured to do so.