Why do some people idealize a leader and create a group that worships him as a demigod?
Because it is precisely in these particular people that the internal analog of such an internalized relationship is activated.
That is, somewhere in the imagination there is an ideal father, an ideal mother. This does not mean that this person had an ideal father or an ideal mother. No, but the lack of them gave birth to an inner person of an ideal father or mother, as an ideal that one is constantly trying to find.
We have all had shortcomings from our parents, but for some people the shortcomings they have had from their parents lead them to create the ideal of an absolute mother who will outshine them, that she exists somewhere. He may not even think about it, he may not even know that he has created this ideal, but the unconscious is looking for it.
And some may find it, let us say, in a sect. They enter a strange sect, religious or otherwise, and there, because they find this absolute embrace (the sect acts like an absolute mother, like an ideal), they surrender, they regress.
To move forward in life, you have to come to terms with the idea that there is no absolute completeness. You will feel the lack within and struggle and find joy in life through creativity and love while there is lack...