While the Gita rejects the idea of free will at the level of Nature and the actions of the egoistic personality, it nevertheless asserts that free will is real. The distinction comes about through the conception of the separation of Purusha and Prakriti, and the true Self and the egoistic personality bound within the action of the Gunas of Nature. To the extent that we identify ourselves with the human personality, we believe we have free will, but analysis shows us that we do not truly have it. When we transfer our view and standpoint to the divine standpoint, outside the workings of Nature, then we identify with the divine Consciousness, the true Self, and at that level, free will exists and can master the actions of Nature.
Sri Aurobindo discusses this further: “The self-assertion of ego-sense is the broken and distorted shadow in our minds of the truth that there is a real Self within us which is the master of all and for whom and at whose behest Nature goes about her works. So too the ego’s idea of free will is a distorted and misplaced sense of the truth that there is a free Self within us and that the will in Nature is only a modified and partial reflection of its will, modified and partial because it lives in the successive moments of Time and acts by a constant series of modifications which forget much of their own precedents and are only imperfectly conscious of their own consequences and aims. But the Will within, exceeding the moments of Tim, knows all these, and the actions of Nature in us is an attempt, we might say, to work out under the difficult conditions of a natural and egoistic ignorance what is foreseen in full supramental light by the inner Will and Knowledge.”
It becomes thus a matter of standpoint and identification that determines whether we are able to exercise free will or not.
Sri Aurobindo, Essays on the Gita, First Series, Chapter 22, Beyond the Modes of Nature, pp. 215-216