Where does attachment come from? The Bhagavad Gita explains that merely by ‘thinking of objects, attachment for them grows’. Shankaracharya calls attachment a ‘liking for things arising from association’. We associate with various people and things, and have various experiences. The mind naturally wants to repeat those associations and experiences that give it pleasure and wants to avoid those that give it pain. Thus, arise raga, attachment, and its corollary, dvesha, aversion. And these lead to desire, anger, and hatred — all serious obstacles for the spiritual aspirant.
Attachments impede the flow of our thought. Just as
obstructions in a stream bed cause the water to form eddies and whirlpools, and
even stagnant pools off to the side, so do obstructions in the mind — desires
and attachments — create thought eddies in which the same thoughts revolve
uselessly over and over again and from which we can’t seem to escape. They are
like scratches in a record: the scratch prevents the needle from continuing in
its groove, and the same passage is played over and over again until one gives
the needle a gentle nudge. We think in the same old ruts, driven by our
samskaras, the tendencies to seek pleasure and avoid pain; and most of us live
in these mental ruts. When we feel trapped by this thinking-in-ruts, when we
want to break free from this bondage, it’s time to apply vairagya (renunciation
or detachment), time to give the needle of the mind a nudge.
Source - excerpts from article titled 'Vairagya - Path To Freedom' by Swami Mahayogananda published in the Prabuddha Bharata Magazine January 2010 issue.