And the Lord G‑d caused a deep sleep to fall upon the man, and he slept, and He took one of his sides, and closed the flesh in its place…[And He made it into a woman] and brought her to the man. (Gen. 2:21)
It is known that Adam was the epitome of all creation, the handiwork of G‑d Himself. He included all holiness and all the souls of Israel. The entire side of holiness was connected to him and included in him.
Also, Adam originally included both male and female, since he was created with the two [connected] bodies. Everything in the world must contain the concept of both male and female…
Everything in the world must contain the concept of both male and female. This is especially true in serving G‑d, where the male and female elements correspond respectively to "remember" and "keep" [referring to Shabbat].
The essence of the male and female elements respectively is the concept of giving and receiving. Thus, for example, a person can attain great attachment, holiness, and purity of thought. Such a person then gives spiritual delight to the supernal Lights, universes, and attributes. This is the concept of the male element.
At the same time, however, this person receives spiritual sustenance from the supernal universes. This is the concept of his female element. All Israel also partake of this female element when this sustenance is transmitted to them, providing them with everything they need. From it they receive "children, life and food", and the like. The Male and Female essences come together to once again give birth through the transmission of love to the world…
The concept on high that bestows spiritual sustenance is the Male Essence. The spiritual flux becomes the semen, and the Male and Female essences come together to once again give birth through the transmission of love to the world. Besides its immediate effect, each deed also affects future generations. The deed is then aroused, giving birth to another spiritual flux at that future date [such as on anniversaries].
It is thus written, "And He took one of his sides"; this means that the side and concept of femininity was taken from Adam. He then "closed the flesh in its place"; G‑d put in its place a concept of the physical. According to this concept, the tzadik has the power to accept the supernal flux and transmit all kinds of good from on high to the lower world. He can even transmit this to the physical.
[parashat VeEtchanan (81c); adapted by Aryeh Kaplan
(The Chasidic Masters/Moznaim Press)]
Adam It is my understanding that Lilith was the first wife of Adam who was attached to him. They were created equal and not taken from the rib like Eve. Lilith felt equal with Adam due to the unique situation and didn't want to obey him. She became a demon due to not wanting to obey God or Adam. Therefore God caused sleep to come upon Adam again and Eve was created from his rib. Eve was more compliant. Yes we all have male and female energy within us. Some people have more male or female energy than others and that cause confusion for some people as to what is their true gender.
Lilith did not turn into demon. This is a distorted patriarchal misunderstanding, a good way to explain rebel behavior of a woman who wants to be equal. 'Rebel behaviour' is also an assumption of the masculine mind.
As written here that Adam had 2 equal sides,two bodies - woman and man-this is how Lilith appears first time. As am equal body. She then left Adam by the right of her free will and equality. She returned back and more over was supporting Adam and Eve later.
Eve had more chances to tbe accepted bexause of her submissive nature. As it is written Creator saw that Adam needed a helper. Or in other words servant qho serves Adamas disability to understand. As Adam himself represents Chochmah... Supreme Wisdom, but lacked Bina the Understanding. Eve was needed. It is sad how whole internet space depicts Lilith as a demon. And it is transmitted to every woman who doesnt obey her man, she is accused later as witch, bitch etc... it happens every day in every country.
We can all speculate to a point how we were all created. In the mean time I am having fun reading all the speculations how it all happened. Just remember God will never give out all his secrets to anyone. No matter how many rocks you over turn, how deep you swim in the sea/ocean or how far you look or go into space.