Ammonia is a good complexing agent because it is a good lewis base. The lone pair of electrons on N atom can be easily donated to central metal.
For example, in the complex [Ag(NH3)2]Cl, two ammonia ligands form a complex with Ag by donating lone pair of electrons on N atom to form coordinate bond.