Part of it is time travel...I'm still trying to figure it all out myself.
As for the Jedi, there are actually two different time lines. Here, they don't...something happened as Luke tried to rebuild the Order. But there's another timeline where he succeeded and the Order is thriving.