While there are cases in which perfect hash functions can be constructed, this is unusual.
Usually, we will have two distinct objects
and
such
that
(their hash values are the same).
We call this a collision, and all the action in hashing is in dealing with them.