Device names such as eth0, eth1, sda, sdb, etc are all handed out in order.
The first ethernet driver to load will hand out eth0 to its first device and continue until it is through loading and discovering ethernet devices. Then the next ethernet driver would get the next available eth number -- so if the first driver assigned eth0 and eth1, then this driver would start assigning with eth2.
Drivers themselves have their own way of discovering and assigning device numbers. Some find in order of IRQ, others find in order of IO Address or Memory address, others (such as 3COM Etherlink III ISA) find and then sort in order of MAC address.
You can specify which driver loads first by modifying /etc/modules.conf. In the case of ethernet controllers just place lines according to the order you want:
alias eth0 tlan
alias eth1 ne2000
In the case of SCSI controllers, you choose by specifying "scsi_hostadapter" in /etc/modules.conf -- which will also translate into the initrd when you run mkinitrd (/etc/modules.conf will control how /linuxrc is written in initrd).
alias scsi_hostadapter sym53c8xx
alias scsi_hostadapter1 aic7xxx
Sometimes lspci can help you investigate this subject more, also see "cat /proc/interrupts".
So in summary:
The order that the drivers are loaded
How each individual driver orders multiples of its devices
IRQ - changing slots may change IRQ
IO Address
Memory Address
Other means such as by MAC Address
Bus/Device/Function # -- see lspci, and cat /proc/pci, changing PCI slots usually changes this