Turns out Yoda wasn’t originally part of the “Return of the Jedi” script. However, child psychologists George Lucas consulted worried that young children may not have believed Darth Vader (David Prowse, voice of James Earl Jones) when he revealed he was Luke’s father in “Empire Strikes Back”. Makes sense, with Vader being a bad guy and Luke being in such a vulnerable situation, clinging to a pole with his hand severed. Luke wasn’t even sure he believed it, as evidenced by the scene where he visits Yoda again in “Return of the Jedi.”
If you recall, Luke returns to Dagobah for more Jedi training after saving Han Solo (Harrison Ford) and Leia (Carrie Fisher) from Jabba the Hutt. He finds Yoda at the end of his life and asks him if Vader was telling the truth. Yoda confirms that Vader East, in fact, Luke’s father and that there is another Skywalker there. (Of course, fans know it’s Leia herself.) Yoda is our hero’s trusted friend and teacher, making it easier for kids to understand and accept this idea.