Since nitrogen atom in ammonia molecule has a lone pair of electrons, it is a Lewis base.
Greater the availability of an electron pair, more is the basic character.
Since alkyl group (R-) is an electron releasing group with (+I) inductive effect, alkyl amines act as a stronger base than ammonia.
The decreasing order of basicity is –

The availability of a lone pair of electrons on a nitrogen atom in amines is influenced by steric factor due to crowding of alkyl groups which affects solvation along with inductive effect of alkyl groups.
Due to high energy of solvation of \({NH}_4^+\) ions,
They acquire higher stability in aqueous solutions.
The presence of alkyl groups in secondary and tertiary amines, due to steric hindrance decrease the solvation energy.
This effect is more in tertiary amines making the tertiary ammonium ions (R3NH+) unstable as compared to secondary ammonium ion (R2N+H2).
Hence the cumulative effect on the order of basicity of amines is,
secondary amine > primary amine > tertiary amine > ammonia (NH3).