Did philosophy evolve by natural selection?
Fundamentally yes, everything that humans think about is a product of both natural selection and our embryology. Did it evolve because philosophy itself is beneficial or is it a byproduct of something else that is beneficial? The question to ask is what cognitive mechanisms are we making use of when we study different areas of philosophy (I don’t know). These mechanisms certainly didn’t evolve to do philosophy, philosophy has only been around as long as human language. They were designed for much more practical things like tracking herds of animals and understanding people.