Mechanism for the reaction of ammonia with water:
To the extent that the mechanism of the reaction is concerned, the ammonia employs its lone pair of electrons to make a new bond to the proton and hence is acting as a nucleophile. The meaning of this is that the water is acting like an electrophile.
Like the nitrogen uses its lone pair of electrons to create the new bond, the bond among the hydrogen and oxygen must break because hydrogen is only permitted one bond. The electrons that are making up the O-H bond will move onto oxygen to generate a third lone pair of electrons, so giving the oxygen a negative charge shown in the below diagram. Because the nitrogen atom on ammonia has employed its lone pair of electrons to make a new bond, it now has to share the electrons along with hydrogen and thus nitrogen gains a positive charge.
Figure: Mechanism for the reaction of ammonia with water.