This is just my understanding.
Philosophy comes up when science is in-adequate. They are just part of the same circle.
Humans have been observing and explaining various natural phenomena due to their 'intellect'. They see patterns that repeat and use that in their daily life. Probably everything was philosophical at the start. As the human capabilities improved, things that get defined, measured and predicted very well, pass onto the realm of science. The rest is termed philosophy.
As the light of knowledge (various types of jnAna) illuminates the circle more and more, the definition, measurement, predictability becomes more and more, and those parts pass into realm of science (vi-jnAna - that we certainly know) from philosophy (saMjnana, sajjnana etc - the whole or true knowledge).
As vaidika maarg got interpreted into a life of pure rituals, siddhartha started questioning it and came up with shunya tattva, saying there's nothing (shunya) beyond this life and human life is result of our own karma.
With the current tools they have, human beings try to understand what's behind life, discover how life rides on matter, how matter evolves, what exists behind the matter, the law (dharma) and order (rta) that make the Universe etc. They have come up now with a similar shunya tattva hypothesis, that there exists nothing beyond and Universe and life are a result of a 'chance' or a set of freaking accidents. Now philosophy has passed into realm of modern science.
Shankara countered this saying there should exist something, but that remains a sAksi (just a witness) who knows the players and the playground, but don't influence anything and just remains a witness. (purusa sAksi or the brahman or the shiva who cannot be perceived without the shakti). How is this non-interacting witness different from a Shunya, if existence of something is equal to non-existence..?
In his philosophy, this witness exists everywhere in every domain and the witness guides the evolution in every domain by mere act of witnessing. In human mind, it is the conscience or manas-sAksi that resides in every being. It's the two birds of Rgveda, one enjoying the fruits and other witnessing the act of eating. Our 'self' (aham) can be identified with both this manas and manas-sAksi.
This philosophical model states that we should identify our 'self' more and more with that manas-sAksi, the witnessing mind that witnesses our own actions and deeds, be detached from the pleasures and plains, see our actions and deeds as same as others actions and deeds, if we want to guide our manas/mind to drive our own evolution and better handling of our life.
How do we develop that detached self to live like water on lotus leaf..? It could be devotion to any external divinity (bhakti) or self-realization (various forms of jnAna, jnA means to know).
With freud's semi-scientific explanation of human consciousness with id, ego, superego, this aham, manas and sAksi. is passing onto scientific realm. As more work gets done on quantum nature of our consciousness (indicating how both energy and consciousness have a similar nature), how the id,self,superego gets developed etc, some of this philosophical model will get accepted, some more detailed and some refined or even rejected. But that's how the journey from philosophy to science happens.
The nature of science or philosophy is to keep changing again and again, like a wave. Because they are continuously evolving, we all get to take a snapshot measurement to understand them. Different people have different snapshots and they explain them in the way they perceive, as I explained here, in one way.