About lamia:
The site is in French, but briefly sumed-up:
The Sumerian had a protector daemon, shaped as a bull with a human head, called a "lama". (The basic design you can see for lamasu, shedu, sphinx, and various others.)
Upon reaching the Akkadians, that benign guardian spirit became the lamassu.
Upon reaching the Assyrians, both lamas and lamassus become the male and female version of the same kind of creature.
Eventually, lamassu becomes lamashtu.
Meanwhile, the Babylonians, redacting stuff about the epic of Gilgamesh, king of Uruk, a thousand year after the events, confuse Kishillilla (the demoness Gil fought) with these newfangled "lamashtu" thingy and change the lama into a child-eating monster. (Interestingly, they also twist the name further by mixing it with Kishillilla's one, eventually stumbling upon "lillithu", which was promised to a brillant career as Lillith among the Hebrews.)
Her shape was a bit diversified by all these travels: her bull (err, cow?) body was swaped for that of a winged serpent or that of a lion.
Upon reaching the Greek, the lama becomes the lamia. Hesodes speaks about a woman named Lamia, who was rap, err, "seduced" by Zeus and got a child from him. Jealous, Hera cursed her to eat her own child. To punish her for this foul crime (no, no, I'm not speaking about Hera there), the gods decided that she would be turned into a monster, condemned to repeat endlessly her sin.
(Just so you know,
never call upon the justice of gods. They can't be trusted.)