I don't profess to be an expert on the daft explanations that Lucas gave in the prequels, but he did give us a reason why Vader, Ben & Yoda, ended up force ghosts.
Palps told Anakin that he had teachings by his old master Darth Plagueis on how to never die with the knowledge of the force, and that he would pass this knowledge on to Anakin if he were to become his Sith apprentice.
This knowledge had a flaw, the power to move on to this afterlife can only be successful if you are pure in soul.....so therefore will be of no benefit to a Sith, only for a Jedi.
So by the time Vader snuffed it, he'd redeemed himself and was pure in soul, so all the teachings of Palps enabled him to become a force ghost.
Ben and Yoda were tought this technique by Qui-Gon who had successfully returned from his spell of being completely dead, i assume his refined teachings also enabled his pupils to vanish when killed.
Mad isn't it
J