Methylamine (CH$_3$NH$_2$) is more basic than aniline (C$_6$H$_5$NH$_2$) because the methyl group is an electron-donating group. It increases the electron density on the nitrogen atom, making it more available to accept a proton. In contrast, the phenyl group in aniline is electron-withdrawing through resonance, decreasing the electron density on the nitrogen atom and thus reducing its basicity.
Step 1: Methyl group donates electrons, increasing basicity.
Step 2: Phenyl group withdraws electrons, decreasing basicity.