Or maybe it was photosynthesis first. The chloroplasts just did their thing for a while, and slugs that digested them slower (and eventually ones that stored them) got more benefit than ones that didn't.
Evolution isn’t a matter of faith, you’re welcome to challenge it and try to poke holes in it.
And if you want to do that, you should probably get a deep set of experience; otherwise, it's not much different from a flat earther.