If AI and robotics continue to be developed, then eventually most human labor becomes uneconomical by comparison. At that point, the system provides passive income on a mass scale (UBI) to prevent its own violent destruction. At least, that's the good ending.