It indexes unit; it maps a value (integer) to a unit.
Let's say we have 2 units, footman(0x01) and footman(0x02), we then tell the Unit indexer to index 0x02, it gives it the id 100. Then we index 0x01 too, the indexer assigns 900 to it. Now, whenever we fetch the integer index for the said unit, it will always return a unique, constant integer index. You can then use that index as an array index (or a struct instance id or slot) for your spells and you won't need to worry about collisions (array index collisions).
I hope you got that, I'm bad at explaining.