The very short answer: coincodence is why. The hashing algorithm made it end up in the same bucket, and the problem it tries to solve is "make sure that the same client always talks to the same backend - yet still try to keep a fairly even spread across my backends".
It's equivilent to other IP-hashing algorithms. On a very basic level:
- You look at the IP-address of the peer contacting you.
- You hash it - doing this gives you a fairly random number (yet, always the same for the same address) - more random than the IP-address, which depending on your users can be very sequential.
- Pick a backend by doing
hash % backends
What you accomplish by doing this, is a fairly even spread of your clients - yet you should be able to expect that the clients keep talk to the same backend for every request. This is very useful if you have session-data stored on each server, for example.
If you just want to spread the load across your backend, and don't have anything to worry about as far as your application goes; Round Robin is a better option - you'll get a more even spread (even though in most cases just marginally - ip_hash works great) - and it will consume slightly less resources due to not spending time hashing the client address.