Bhagavad Gita: Chapter 12, Verse 12

श्रेयो हि ज्ञानमभ्यासाज्ज्ञानाद्ध्यानं विशिष्यते |
ध्यानात्कर्मफलत्यागस्त्यागाच्छान्तिरनन्तरम् || 12||

śhreyo hi jñānam abhyāsāj jñānād dhyānaṁ viśhiṣhyate
dhyānāt karma-phala-tyāgas tyāgāch chhāntir anantaram

śhreyaḥbetter; hifor; jñānamknowledge; abhyāsātthan (mechanical) practice; jñānātthan knowledge; dhyānammeditation; viśhiṣhyatebetter; dhyānātthan meditation; karma-phala-tyāgaḥrenunciation of the fruits of actions; tyāgātrenunciation; śhāntiḥpeace; anantaramimmediately

shreyo hi jnanam abhyasaj jnanad dhyanam vishishyate
dhyanat karma-phala-tyagas tyagach chhantir anantaram

Translation

BG 12.12: Better than mechanical practice is knowledge; better than knowledge is meditation. Better than meditation is renunciation of the fruits of actions, for peace immediately follows such renunciation.

Commentary

Many people are at the level of mechanical practice.  They perform the rituals enjoined by their religious creed, but do not engage their mind in God.  When they purchase a new house or a new car, they call the Pundit to perform the pūjā (worship) ceremony.  And while the Pundit performs the pūjā, they sit and talk in the other room or sip a cup of tea.  For them, devotion is nothing more than performing the empty ritual.  It is often performed by way of ceremonial habits that have been passed on from parents and elders.  Performing rituals mechanically is not a bad thing, for after all, something is better than nothing.  At least such people are externally engaging in devotion. 

However, Shree Krishna says that higher than mechanical practice is the cultivation of spiritual knowledge.  Knowledge bestows the understanding that the goal of life is God-realization and not material progress.  One who is versed in knowledge goes beyond the empty rituals and develops the desire to purify the mind.  But mere knowledge by itself cannot cleanse the heart.  And thus, Shree Krishna says that higher than the cultivation of knowledge is the process of engaging the mind in meditation.  By practically controlling the mind through meditation, we begin to develop detachment from worldly pleasures.  When the mind develops some measure of the quality of detachment, we can then practice the next step, which is renunciation of the fruits of actions.  As explained in the previous verse, this will help remove worldliness from the mind and strengthen the intellect for the subsequent higher stages.