The question you have put raises one of the most difficult and complicated of all problems and to deal with it at all adequately would need an answer as long as the longest chapter of The Life Divine. I can only state my own knowledge founded not on reasoning but on experience that there is such a guidance and that nothing is in vain in this universe.
If we look only at outward facts in their surface appearance or if we regard what we see happening around us as definitive, not as processes of a moment in a developing whole, the guidance is not apparent; at most we may see interventions occasional or sometimes frequent. The guidance can become evident only if we go behind appearances and begin to understand the forces at work and the way of their working and their secret significance. After all, real knowledge—even scientific knowledge—comes by going behind the surface phenomena to their hidden process and causes. It is quite obvious that this world is full of suffering and afflicted with transience to a degree that seems to justify the Gita’s description of it as “this unhappy and transient world”, anityam asukham. The question is whether it is a mere creation of Chance or governed by a mechanic inconscient Law or whether there is a meaning in it and something beyond its present appearance towards which we move. If there is a meaning and if there is something towards which things are evolving, then inevitably there must be a guidance—and that means that a supporting Consciousness and Will is there with which we can come into inner contact. If there is such a Consciousness and Will, it is not likely that it would stultify itself by annulling the world’s meaning or turning it into a perpetual or eventual failure.
[Sri Aurobindo: Letters on Yoga]