Phosphorous lies directly below nitrogen in the periodic table. Consequently you might expect the chemistry of these two elements to be similar. Within limits your expectations would be realized. Both amines and phosphines can act as nucleophiles as outlined in Figure 1A .
However, the methyl hydrogens of the ammonium salt in Figure 1 are much less acidic than those of the phosphonium salt. This is because the conjugate base of the ammonium salt is much less stable than the conjugate base of the phosphonium salt. As mentioned previously, the conjugate base of the phosphonium salt, the ylide, is stabilized by resonance; the electron pair on the carbon atom can be donated into an empty d orbital on the phosphorous. Figure 2A compares the potential stabilization of negative charge in the nitrogen and phosphorous ylids.
In the nitrogen ylide it is not possible for nitrogen to accept electron density from the negatively charged carbon since the nitrogen does not have d orbitals available. The structure in the lower right corner of Figure 2A violates the octet rule. The phosphorous ylid does not violate the octet rule because, as a third row element, phosphorous can accomodate an additional 10 electrons in its valence shell.