The nature of attachment is subtle and complex, but the qualty of attachment makes all the difference in an individual's ability to be successful in work and relationships, and to be able to truly enjoy life.
Attachment defined is having a psychological connection to others that involves balancing one's needs with those of others. Starting in infancy, this process begins with nursing, holding, eye contact and rocking. This is Erikson's first stage of psychosocial development as explained in depth here. The brain is wiring itself to the external world for the first time, and the nature of this first life experience lays the groundwork for how the brain forms. This process influences the individual's ability to interact effectively with others and to self-regulate emotions and impulses.
This should not be taken to mean that this is the only influence affecting development. The attachment process is constantly evolving across the lifespan. There are, however, some windows of development that are more critical than others. As Erikson asserts, each stage's development is dependent on development of the previous stage.
Birth through about the age of 2 is thought to be the most critical stage in this process, as primary psycho-social functions are just begining to develop. During this time, basic trust is the task at hand. This is built on by a responsive caretaker that consistently alleviates distress whether it's hunger or anxiety. When distress is relieved, the infant comes to see the caretaker as "good," and at this stage, not yet seeing himself as a separate entity, the infant thus sees himself as "good" as well. This lays the groundwork for later development of conscience and being able to form and sustain relationships. Around age 2 to 3 the next stage of development occurs, which involves sense of autonomy vs. shame, which coincides with a toddler's beginning to assert their will and confront limits with others.
Reactive Attachment Disorder first became talked about more commonly with the discovery of the problems of children raised in inadequate orphanages where there might have been one caretaker to 20 infants. The disorder is also often seen in children who have been in foster care and have had multiple placements where attachments were repeatedly formed and broken. These children did not build the foundations of trust, as they may have had unreliable schedules of feedings and changings, and may not have had consistent holding and cuddling, and certainly not with one or two caretakers but a constant change of caretakers. When adopted, these children seemed to be readily accepting their new family, but once settled in, problems with close relationships emerge.
Interestingly, more than half the population has some degree of attachment disorder. Just as no one is perfect, no parent is perfect, and all children misbehave. The assignment of personalities within a family is largely random, despite some hereditary tendencies, which may also be learned behaviors.
Sometimes, there is simply a mismatch between the child's developing neurology and their environment. This does not mean that the parents are doing a bad job, but that the child's psycho-neurology has specific yet unidentified needs that aren't being met. As any parent will tell you, kids don't come with an instruction manual, and no two kids are exactly alike. Often with each child, figuring them out starts from scratch.
Can attachment disorder be corrected? The answer is: for most kids, and to a large extent. In the most serious form, Reactive Attachment Disorder, specialized treatment may be required. Specialized treatment foster homes, where a caregiver has taken advanced training, are designed to help the child re-learn beliefs and patterns of relating. While there is currently no standard treatment for Attachment disorder, treatment aims at correcting the child's disturbed internal working model of relationships and sense of self. Medication can help to modify mood and arousal levels, which is for some children, critical to their ability to respond to interventions. Parents or primary caretakers are the real instruments of change. This is not about fixing "bad" parenting, but about helping parents regain their rightful place as benevolent authority figures and providing the child with secure containment in which to build a sense of self-control and connectedness with others.
If you want to know more, here is a link to Mayo Clinic's suggestions for coping with a child with behaviors associated with Reactive Attachment Disorder. I also recommend the books, "Adopting the Hurt Child" and "Parenting the Hurt Child" by Keck and Kupecky.