To understand the Mahabharat and other epics completely, one must realize the way in which they are written. People of those times used a lot of similes and metaphors to convey ideas to ordinary people. Here is a quick example.
During the Vishwaroopa Darshana, it is said that Arjuna could see the original form of Krishna (Vishnu) with a 1000 heads, etc. Usually, thousand (sahasra) and crore (koti) are metaphorically used for infinite. Arjuna, actually saw the omnipresence/omnipotence of Krishna.
Now coming to the question, Krishna did not stand on the battlefield and preach the Gita to Arjun as you can see in paintings such as this.
People of that age were so high up the Yogic knowledge, that they could perceive things in a way that we are still re-discovering. It is said in the Mahabharatha that people carrying out strict austerities had the power to read minds. They could also sow an idea into the mind. So it is possible that Krishna nudged Arjuna’s mind ever so slightly in a direction which ultimately led him to enlightenment.