Why .NET, Ruby and Java compare structures by its hash code?

How about recursive structure comparison?

Anyone know this?