An application can determine to which remote device it should talk in several ways:
hard-wired
a stored preference
selected by the user
determined programmatically
Each of these may be appropriate in different situations. In the first couple of cases, the address of the remote device is simply retrieved from storage. Functionality for the third case is provided by the Bluetooth Device Selection UI.
The final case, the program itself determining the remote device, could be adopted for the following reasons:
to provide a customised device selection UI to the user
to select a device based on some other context, for example, "use the least busy LAN access point"
The next page discusses in detail how to go about this.