The goal of meditation is to cultivate a sense of calm, control and detachment. By turning deeply inwardly, we are able to gain awareness of the turbulence of our mind. Our mind is like a running elephant with so many thoughts stomping around. We become aware how forces such as attachment and fear are such strong forces in our lives. Once we realize through this state of awareness, that all things are changing, one can adjust to the fact that one doesn't have any control over this constantly shift reality. Why should we be attached to anything when nothing is permanent, everything is changing?
Meditation helps us to become comfortable with this self-understanding of one's perception. Yoga also holds that consciousness is closely related to our subconscious by exerting superior control on the conscious states, we can control our subconscious one in which are contained deeply ingrained beliefs and behaviors that may not be healthy or positive or beneficial for humanity. Since we often think and act in ways that we know are not positive or healthy, we often feel powerless to change. Mediation helps to gain the necessary awareness since it gives us access to the subconscious.
Knowledge is not enough in destroying unhealthy tendencies. A graduated practice of deep reflection that begins with steadying the mind on its deeper levels helps to ultimately uproot these yucky habits, though-patterns and tendencies.