«أَكْرَمْتُ مَنْ زَارَنِي» — I honored the person who visited me: relative «مَنْ» as object.
«مَنْ يَجْتَهِدْ يَنْجَحْ» — Whoever works diligently succeeds: conditional «مَنْ», governing jussive verbs.
This additional teaching comparison illustrates why the context determines the function of identical written forms.