While searching how to identify cations in a solution I found that ammonia could be used to distinguish between $\ce{AgCl}$ and $\ce{PbCl2}$ precipitates after $\ce{HCl}$ had been added.
Why does the addition of ammonia cause $\ce{PbCl2}$ to dissolve while $\ce{AgCl}$ doesn't? (With chemical equations if possible.)