Whenever one phenomenon, by virtue of its own qualities, pulls another phenomenon towards itself, it is called attraction.
On all the conceivable scales of life, can there be found this condition of attraction. Matter from the tiniest of particles, to the matter of the whole universe is kept together through the condition of attraction. While mind, from the pettiest or coarsest of desires, to the loftiest feeling of love, too is an expression of this condition.
But how can we understand the condition of attraction in matters of the four elements?
All things of substance, fall to the earth. That is the attraction of the earth element.
All things of moderate substance get dispersed within water due to the attractive quality of water, which attracts the different parts of a compound more than the parts attract each other.
All things of little substance follow the direction of the wind. That is the attraction of the wind element.
All things living feel attracted and grow towards the light. That is the attraction of the fire element.
However there is another way of thinking about the elements under this condition. And that is in matters of affinities towards one another. Thus we find that earth and water have some natural affinity, and so it is with fire and air. In each pair the elements form a perfect supplement to one another. The knowledge of which gives us a certain clue as to a better harmonisation of these elements.
The matter of the physical body, vivified by life, too is susceptible to this condition of attraction. Each body part has its particular counterpart. And thus, when any particular body part becomes vivified by the element of life (the faculty of life), it produces a certain sense of attraction towards that corresponding counterpart.
So will an empty stomach, vivified by life, produce a certain attraction towards food. The lungs, vivified by life, will produce an attraction towards the air element. The sexual organs, vivified by life, will produce an attraction towards a person (usually) of the other gender, or to other things of a sexual nature. The sense-organs, vivified by life, produce an attraction towards beautiful sights, sounds etc.. And a brain, vivified by life, will produce a certain attraction towards things which might stimulate the intellect or intelligence.
And for a mind, that is deeply attached to the life of the body, these attractions then will dominate the activities of the mind.
However, the mind also has its own life, which too is within the domain of this condition of attraction. Hence we find, that different states of mind, are equally attracted to certain direct counterparts.
So will for example a restless mind be attracted to activity.
A peaceful mind usually is attracted to non-activity.
An angry mind is easily attracted to quarrels and fights.
A greedy mind is quickly attracted to various goods.
A depressed mind, will be attracted to gloomy environments.
A joyful mind will be attracted to bright environments.
A brave mind is attracted to adventure.
A fearful mind is attracted to security.
A lazy mind is attracted to things of comfort.
A loving mind, is attracted to people and animals of various kinds.
A hateful mind is attracted to usually people of a specific kind.
And an objective mind is attracted to justice. Etc.
But then, there is also the condition of consciousness, where consciousness is attracted not to counterparts of the bodily organs or senses, nor to matches to certain mind-states, but rather to counterparts or matches to certain kinds of kamma performed in the past.
A past wish or aspiration to become a monk or a scholar, for example*, even more so if vivified by supportive actions, will cause that consciousness to be attracted to learned people, books, libraries, etc. While a past wish to become a rich businessman will equally so attract consciousness to items of a particular kind. In that case it will be rather items as money, luxury goods, and the like. And as the consciousness becomes attracted towards those things; the mind, —viz. the life-continuum, with its mental life, emotions and desires— will start vibrating in accordance with the strength of the past kamma. Which in turn will then also move the body into various activities, directed at getting closer to the thing which is thought to be attractive.
A similar thing applies to the condition of habits. A habit of playing a certain sport or an addiction to drugs will cause a force of attraction to arise whenever “the time has come” for the next repetition of the habit. That is, it will cause the mental life (the mental life faculty) to vibrate in accordance with the strength of the habit. And this force will attract the body into proximity of its object of desire, or into the condition wherein the habit can be accomplished.
All these a meditator will have to struggle with. And as he struggles with them, here and there, he will find some perception of the subtle, of the higher, of the beautiful, of the peaceful — Nimittas (signs) of the fine-material world. Allowing his consciousness, while maturing in the struggle, to learn how to think about and respond to perceptions of the fine-material world. Which will naturally lead it to gradually disengage from all things material or sensual, simply because consciousness will feel increasingly more attracted towards the subtle, the higher and the beautiful.
Finally, as consciousness ascends, ultimately it seeks to transcend attraction towards anything phenomenal whatsoever, however subtle or sublime. Hence, in Nibbāna, the distinction between subject and object completely dissolves, transcending the very nature of attraction.
Have a look also at How to develop Right Attraction? and Attraction and Unity
* The aspiration having come about due to having perceived something attractive in the idea of it.