Fiona Adams, 23, pleaded not guilty to the murder of Niamh, five, and two-year-old Cayden, who died in the blaze in Buxton, Derbyshire, in April 2010.
She escaped from the house by jumping from an upstairs window with her eight-month-old son, Kiernan, just before midnight on April 23.
Opening the case for the prosecution at Nottingham Crown Court, Timothy Spencer QC told a jury that Adams, who appeared in the dock wearing a white T-shirt above which evidence of the fire could be seen in what appeared to be burn scars on her neck, sought attention from her partner James Maynard, the children’s father, after their relationship broke down.
Spencer told the jury of seven men and five women: “Fiona Adams in the spring of last year was in an unhappy situation. No decent human being could fail to have sympathy with her predicament.
“There were many ways with which she could have dealt with things, what she chose to do was to create a drama around herself and her children and that drama culminated in her setting fire to her own home.
“She and her youngest child were spared, but with serious injuries, but her two eldest children, aged two and five, died in the fire.”
He said Adams found out 28-year-old Maynard had cheated on her several times, the first being shortly after the birth of Niamh which distressed her considerably and also led her to threaten suicide.
The court also heard that despite the couple’s troubled relationship they went on to have another child with the birth of Cayden in September 2007.
However, they split up in May 2008 after Adams found out for definite about Maynard’s relationship with the other woman.
After finding out that relationship had continued through their separation, Adams attempted suicide again, Spencer said.
In the same month of June, 2008, Adams sent Maynard a text message saying she loved him and “he would be better off without her” before again taking a further overdose, Spencer said.
Maynard obtained a court order shortly after this, in August 2008. That meant the children went to live with Maynard at his mother’s house although Adams was allowed unsupervised access to them.
Adams, who also denies causing grievous bodily harm and arson with intent, reconciled with Maynard at some point in late 2008 and gave birth to Kiernan in August 2009, Spencer said.
Spencer said she had become increasingly paranoid and mistrusting of him after his infidelities, even setting up a false Facebook account to track his activities.
The trial resumes today.