[1] The position of mashgiach ruchani arose with the establishment of the modern "Lithuanian-style" musar yeshivas.
The prototype of this new type of rabbinical leader and educator was Rabbi Nosson Tzvi Finkel (1849-1927) known as the Alter (elder) of the Slabodka yeshiva, Yeshivas Knesses Yisrael (Slabodka), in Lithuania.
The role of the mashgiach ruchani was strongest in the era before World War II, when often the mashgichim were responsible for maintaining the yeshiva financially, recruiting and interviewing new students, and hiring staff, something akin to academic deans.
After the Holocaust, the influence and position of the mashgiach decreased, and the roles of the rosh yeshivas have grown at the expense of those of the mashgichim.
Chabad yeshivas have a similar position referred to as mashpia, meaning a person who provides (spiritual) influence.