During the time between Return of the Jedi and The Force Awakens, Luke Skywalker was setting up his Jedi Academy. In the years that The Mandalorian takes place, the school is beginning to be built, and Grogu was one of the first students. He predates Skywalker’s nephew, Ben Solo, who was still a small child when all this happened.
The subject of this Star Wars Questions post is, why did. Luke Skywalker train Grogu and what was the purpose behind it?
Now, everyone who knows Star Wars will know that by the time Yoda (on his deathbed) had made Luke Skywalker a full Jedi, many were dead or still hiding from the Empire. Ezra Bridger was still missing. Ahsoka Tano, the former student of Anakin Skywalker, was still running around. Kanan Jarrus had been dead for a few years. Obi-Wan Kenobi was also deceased. Luke was one of a dying breed of being that his father helped destroy all those years ago.
Training Grogu was the first attempt at creating a new Jedi Order, but even Luke could see that his heart wasn’t in it as he wanted to be with his adoptive father, Dinn Djarin and missed him greatly. However, when this failed, he allowed the padawan to return to his father. This left him with having to training his nephew, which would’ve happened anyway and we all know how that ended up turning out.
In conclusion, Luke Skywalker training Grogu was a test to see if he could do it like the Jedi. However, it should have been a sign of what was to come.