In short, from natural selection’s point of view, it’s good for you to tell a coherent story about yourself, to depict yourself as a rational, self-aware actor. So whenever your actual motivations aren’t accessible to the part of your brain that communicates with the world, it would make sense for that part of your brain to generate stories about your motivation.