It is initialized with the customer default addres or with the first address found if there is no default address.
If this address is assigned, it is allocated to the ship-to customer if it is not assigned, the allocation will be set to the sold-to customer.