Aniline is a weaker base than ammonia due to the presence of an electron-withdrawing group, namely the phenyl group (-C6H5), attached to the nitrogen atom in aniline's structure. This group has a delocalized pi electron system that withdraws electron density from the nitrogen atom, making it less available to accept a proton (H+). In contrast, ammonia (NH3) does not have any such electron-withdrawing groups and is therefore more basic.
The presence of the phenyl group in aniline decreases the electron density on the nitrogen atom, making it less nucleophilic and less likely to donate electrons to form a bond with a proton. As a result, aniline has a weaker ability to accept a proton and acts as a weaker base compared to ammonia.
Additionally, the resonance effect of the phenyl group further stabilizes the aniline molecule by delocalizing the lone pair of electrons on the nitrogen atom into the aromatic ring. This additional stabilization reduces the availability of the lone pair for protonation and further weakens the basicity of aniline.
In summary, the electron-withdrawing nature of the phenyl group and the resonance effects in aniline decrease the basicity of the compound compared to ammonia, making aniline a weaker base.