Basic strength of compunds [duplicate]

Why is Ammonia stronger than Phosphine in terms of basic strength? I am confused as Nitrogen is more electronegative than Phosphorous.

The strength of a Lewis base corresponds to the strength of its conjugate acid. As usual, a weak acid will give a stronger base, therefore parent acids with higher pKa's deprotonate to stronger Lewis bases. ammonium, $\ce{NH4+}$, has pKa=9.25, while phosphonium, $\ce{PH4+}$, is a much stronger acid with pKa=~-12. Basicity decreases down the group because proton affinity decreases as electronegativity decreases. The N-H bond is stronger than the P-H bond (hence $\ce{NH4+}$ is a weaker acid than $\ce{PH4+}$).