Yoda went into exile on Dagobah after the Jedi Order fell during the events of Revenge of the Sith. He retreated to avoid detection by the Empire.