God is a substitute attachment figure
Psychologists have observed that humans have an innate tendency to bond with "attachment figures", such as primary caregivers, friends and romantic partners. It is possible that theists belief in a personal relationship with God is an imaginary product of the attachment faculty of humans.
"a personal God is [...] nothing other than the exalted father. [...] This we recognize that the roots of the need for religion are in the parental complex; the almighty and just God, and kindly Nature appears to us as grand sublimations of father and mother."
- "For many people, their connection to God is an attachment relationship and can be categorized as secure, anxious, dismissive-avoidant, or fearful-avoidant (Kirkpatrick, 2005). Not surprisingly, the psychological effect of religious involvement seems to be determined by the type of God in which a person believes."
- Sigmund Freud, 'Leonardo da Vinci and a Memory of his Childhood', in Complete Psychological Works Vol.11, p.123.
- Alyson M. Stone, Thou Shalt Not: Treating Religious Trauma and Spiritual Harm With Combined Therapy, Group, Vol. 37, No. 4 (Winter 2013), pp. 323-337