Ammonia act as a Lewis base. N atom of ammonia has lone pair of electrons which it can easily donate to suitable acceptor.
Note: A lewis base is a species that can donate a lone pair of electrons.
For example, ammonia can donate a lone pair of electrons to proton to form ammonium ion.
NH3+H+→NH+4