[deleted]
There are two main camps when it comes the origins of the evil stepmother trope and I'll call them "the inheritance theory" and "the psychological theory."
The inheritance theory says that the evil stepmother trope has concrete historical roots in the form of frequent conflict between the children of the first marriage with their stepmother and half-siblings over the father's assets after his death. While we often think of stepmothers as a modern phenomenon, they were not. The high rates of women dying in childbirth in the past meant it was not uncommon for children to lose their mothers while they were still quite young and for their fathers to remarry. While children might not have been totally conscious of the future issue of the inheritances, the stepmothers most certainly would have been aware that whatever children they had with their husband were almost certainly not going to be the primary heirs unless the children of the first wife all died. This was especially an issue for royalty and titled nobility: only one child could inherit the title of king or duke or count, after all. If she had no children with the father, but only with a previous husband, then the issue became even more urgent because she might even receive only her dower after the father's death while her children by her previous husbands might be left with virtually nothing. The German fairy tale, "The Juniper Tree" is one of the few that makes the financial motives of the evil stepmother explicit: she hates and mistreats her stepson because she wishes that her own daughter, Marlinchen, would inherit all of the father's fortune.
The inheritance theory has much to recommend it. There are numerous examples in history of women who were in conflict with their stepchildren over their wish for their own children to inherit. An early example is the Anglo-Saxon queen, Ælfthryth, who possibly organized the murder of her stepson, Edward the Martyr, so that her own son, Æthelred the Unready, could become the king of England instead. Sichelgaita of Salerno, the Lombard second wife of Robert Guiscard, is another example: the chronicler Orderic Vitalis claimed that Sichelgaita poisoned Robert and then tried to poison her stepson, Bohemund, so that her own son, Roger Borsa, could inherit the title Duke of Apulia.
Though less violent, there was also notoriously conflict between Ralph Neville, 2nd Earl of Westmorland and his stepgrandmother, Joan Beaufort. You see, even though she was a legitimized bastard, Joan Beaufort had royal blood in her veins, as she was the only daughter of John of Gaunt and his long-time mistress, Katherine Swynford, and thus the granddaughter of Edward III. Perhaps because of his second wife's royal blood, the first Earl of Westmorland's will secured numerous inheritances for his five surviving sons and rich dowries for his five daughters by Joan, which severely cut into Ralph Neville's inheritance. A further bone of contention was over Joan's dower, which (among other things) entitled her to live at Raby Castle until her death. Ralph Neville spent much of his life trying to recover the inheritances he regarded as his, as he was the heir by primogeniture, but was unable to do so because of the powerful connections that his stepgrandmother and half-uncles and aunts all had: Eleanor was married to the Earl of Northumberland, Katherine to the Duke of Salisbury, Richard was the Earl of Salisbury (jure uxoris) and father of the famous "kingmaker", Anne was married to the Duke of Buckingham, and Cecily was married to the Duke of York. When the Wars of the Roses broke out, the two branches of the Nevilles went in opposite directions, with the descendants of Margaret Stafford mainly being Lancastrians while the descendants of Joan Beaufort were mostly Yorkists.
The psychological theory, on the other hand, posits that the figure of the evil stepmother in fairy and folk tales was and remains popular because it allows children to "safely" express all of the hatred that they feel toward their mothers by putting it on a maternal figure who is safer to express hatred of because she's not the child's "real" mother. This was a theory that was invented or at least popularized by Bruno Bettelheim, who has since become extremely controversial, to say the least, but I thought I should mention it regardless.
Sources:
Abate, M. (2012). "You Must Kill Her": The Fact and Fantasy of Filicide in "Snow White". Marvels & Tales, 26(2), 178-203.
Bettelheim, B. (1989). Transformations: The Fantasy of the Wicked Stepmother. In Oring E. (Ed.), Folk Groups And Folklore Genres Reader: A Reader (pp. 178-184). LOGAN, UTAH: University Press of Colorado.
Gray-Fow, Michael J. G. “The Wicked Stepmother in Roman Literature and History : an Evaluation.” Latomus, vol. 47, no. 4, 1988, pp. 741–757.
Haase, D. (2000). Feminist Fairy-Tale Scholarship: A Critical Survey and Bibliography. Marvels & Tales, 14(1), 15–63.
Watson, P. A. (1995). Ancient Stepmothers: Myth, Misogyny and Reality. Leiden: E.J. Brill.
Williams, C. (2010). Who's Wicked Now? The Stepmother as Fairy-Tale Heroine. Marvels & Tales, 24(2), 255-271.