Aah, you're talking about the debate between determinism and free will if i recall correctly.
This actually relates mostly to what our perception of free will.
In a scientific aspect, this dogma can be overcame by flat spacetime theory. Though we still can not actually prove it but as in many other theories that we base on, its based on math and equations.
Philosophically speaking, to explain it as simple as i can and at best i can, we have free will in our actions if we took each action and each moment individually, however if we took it as a series of actions and choices, each choice is determined by a former completed choice and prefference built based on our previous experiences.
Free will and determinism meet on the same plain and become compatible together rather than contradictory when we take previous experience- based preferences and individual reasoning.
while looking at it as whole system from an outside observer perpective gives you the conclusion that everything is predetermend.
You also should look at it as an insider observer to know what makes the actions determined, which will give you the conclusion that the determination comes from within ourselves first.
Basically, while we're part of a much larger system and merely interact with all the other pieces in it.
Our decisions are not based on a pre-determined order in the system, rather its based on our own perception, understanding and experience within the system which shapes our preferences and reasoning.
Thats called soft-determinism
Now there is also anther view for it in a religious aspect and anther in a theological aspect, but thats for anther debate.
EDIT:
There is a little story i feel like mentioning. Its not something 'll debate here, but i just thought of bringing it up to expand on the former.
Its related to the topic, and its quite an interesting one in matter of philosophical meaning when you think deeper into it and specially when in such debate about free will and determinism.
The story is in the Hadith, i.e its an Islamic story.
Its about a society mentioned to be somewhere in the levent but i don't recall exactly which one.
Anyways, this society (a small village better say) was almost entirely made of sinfull people, there is nothing they wouldn't do, no crimes they wouldn't cross to, etc. But, there was a man, who was a true worshiper of god, and a true believer. cutting through the story, in the end, said that when god's punishment comes, all will be punished, even including the good man.
Now the lesson behind it is to show the importance of calling people for rightousness and good deeds and away from sinfull and harmfull deeds. And along with social responsibility.
But it goes deeper into the whole argument of determinism and free will.
When you think about it, one of the things about the middle ground between hardcore free will principle and determinism (i.e soft determinism or compatilisim <check name) is that while you have free will, what is determined mainly isn't your choice but rather your options.
This in one hand gives way to a modern idea that free will is simply the sense of control.
But in regard to the basic argument, it shows that while you're free to choose, in one hand your choice would determine a set of other choices based on it, and not only for you but also for people effected by it, and the same goes on. And on the other hand your choices were determined by a previous set of choices that was both yours and not yours.
This shows how much we're not only interconnected to the system, but also that we can and do effect the set of outcomes.
Now back to the point of the story, its shows a few things to be considered.
1- That our actions will effect others and their actions along the way, and if we did the right thing, the outcome would be better, and vice versa.
2- This presses even more importance to the Islamic view of social harmony. When the prophet described that the nation is like a single living body, if one part goes ill, all goes ill.
Basically, not only that the greatest good can only be achieved when the entire society is in full harmony on the right path, but also that it is important to act in a way to bring that state even if its not in hand.
And 3- which is the degree of responsibility we have over our actions. That not only we're responsible for our actions, but we hold proportionate responsibility for all the results our actions has caused.
A lack of actions is still an action.