Many a spiritually related slokas should be studied, discussed and understood studying the issue as a whole. Otherwise it will convey a different meaning and results in confusion.
The 7th chapter of BG is the continuation to the last sloka of previous chapter, ie.6th chapter.
Sri Krishna was stating that those who practises sadhana (austerities) fixing one's concentration on HIM will attain the ABSOLUTENESS.
योगिनामपि सर्वेषां मद्गतेनान्तरात्मना।
श्रद्धावान्भजते यो मां स मे युक्ततमो मतः।।6.47।।
Even among all the yogis, he who adores Me with his mind fixed on Me and with faith,he is considered by Me to be the best of the yogis.
मय्यासक्तमनाः पार्थ योगं युञ्जन्मदाश्रयः।
असंशयं समग्रं मां यथा ज्ञास्यसि तच्छृणु।।7.1।।
The Blessed Lord said O Partha, hear how you, having the mind fixed on Me, practising the Yoga of Meditation and taking refuge in Me, will know Me with certainly and in fulness.
Here one should not get mistaken that Sri Krishna made above statement as if He was an incarnation of Vishnu or something else.
Sri Krishna, being a Yogi of highest order, had merged in the ABSOLUTE,ie., the God, and thus became the ABSOLUTE. It will happen to any Yogi who reaches that state.
However, attaining this highest knowledge is not everybody's cup of tea. It is very difficult for ordinary people even to think and practice in that line for a longer period. One's desires and prarabdha will not allow one to practice in that line for longer period.
मनुष्याणां सहस्रेषु कश्िचद्यतति सिद्धये।
यततामपि सिद्धानां कश्िचन्मां वेत्ति तत्त्वतः।।7.3।।
Among thousands of men a rare one endeavours for perfection. Even of the perfected ones who are diligent, one perchance knows Me in truth.
In continuation to the above declaration, Sri Krishna said that those who adore deities with the object of fulfilling their materialistic desires, will pray to the deities.
तं तं नियममास्थाय प्रकृत्या नियताः स्वया।।7.20।।
People, deprived of their wisdom by desires for various objects and guided by their own nature, resort to other deities following the relevant methods.
It is like praying to Ganapti for removing obstacles, Lakshmi for getting riches, Saraswati for getting education, etc.