Attachment theory comes from John Bowlby and Mary Ainsworth and describes how an internal model of how available others are forms in childhood. The anxious style typically arises where caregiving was inconsistent — sometimes warm, sometimes unavailable, with no predictable pattern.
A child in that situation learns that closeness is possible but not guaranteed, and that the only strategy is constant monitoring. In an adult this becomes: obsessively reading the tone of a message, needing repeated confirmation, panicking at a delayed reply, escalating conflict to get a reaction — any reaction being more bearable than absence.
The hard part is that the strategy produces exactly what it fears. Intense demands for reassurance tire the partner, the partner withdraws, the withdrawal confirms the fear.
Styles are not fixed. Longitudinal research shows they can change within stable relationships and in therapy — the notion of “earned security” describes precisely this.