Why is pyridine more basic than aniline?
The strength of basicity depends on the tendency to donate an electron to the electron deficient element, ion or group.
In case of aniline, the lone pair of electrons on nitrogen atom takes part in the resonance with the pi electron of benzene ring.