Repeater nodes keep a list in EEPROM on where to send messages (next hop) so they'll reach the final target. This table is kept updated by inspecting messages arriving to the repeater. You'll probably have to look in the code for more details.