Devotion to God does not rise in vacuum. It needs years of effort and self-purification.
True devotion arises from the predominance of sattva and sattva comes from inner
purification, for which detachment and control over desires are very important.
By merely studying the scriptures and acquiring knowledge none can achieve liberation.
You may get rewards and appreciation for your scholarship, but it is not sufficient
to transcend your lower nature.
According to the Bhagavadgita the natural sequence of progress on the spiritual
path is first you should learn to perform desireless actions. You have to transcend
your love for wealth and possessions by overcoming your desires and offering your
actions to God. This is karma yoga, the first step in your inner perfection.
Inherent in karmayoga is the idea of renunciation (sanyasa). Renunciation in the
context of the Bhagavadgita means renunciation of the desire for the fruits of your
actions. In other words, you must live and act without expectations, with a sense
of sacrifice. When you succeed in that, you will realize the true purport of the
scriptural knowledge. You will gain insight into the teachings of the Vedas, the
Upanishads and other scriptures. From that arises the knowledge of the Self. This
is jnana yoga, the second step.
When you are fully saturated with that knowledge, you surrender to
the God (soul) in you. You put aside your ego and personal cares and concerns. You
practice atma samyama yoga (concentration and absorption in the Self) until you
are one with your inner Self. This is the state of devotion, the final step.
Thus devotion arises from self-knowledge and self-knowledge arises from renunciation
of desires and performance of selfless actions. Ignorant people cannot truly worship
God. They will be driven by other consideration and worldly concerns. This is the
essence of the teaching contained in the verses 7-11 of Chapter 10.