Angela Wrightson, 39, was beaten to death in her home in Hartlepool, Teesside, in December 2014.
Two girls, then aged 13 and 14, deny murder.
Forensic psychiatrist Dr Indranil Chakrabarti was giving evidence at Leeds Crown Court with regard to the older girl, who is now 15.
She has admitted manslaughter.
He said the girl had a condition called Other Mixed Disorder of Conduct and Emotions which made her act in an "aggressive, violent and cruel" way.
She also has a very low IQ - of between 60 and 70 - Dr Chakrabarti said, which made it difficult for her to understand the consequences of her actions "either for herself or for her victim".
He added the girl had a family background of violence, which would "trivialise" her perception of what level of force "would be deemed excessive".
The girl, who was not in court, had also experienced auditory and visual hallucinations, but Dr Chakrabarti said they were "not significant enough" to indicate a psychotic illness.
"Her mental impairment means her behaviour is aggressive, dangerous and cruel to others," he told the court.
"Her mental abnormality, coupled with her low IQ and the commonality of violence in her home life, provides a reason for the attack on Angela Wrightson," Dr Chakrabarti said.
The trial continues.
A girl accused of murdering a vulnerable woman had a mental condition which meant she did not understand what she was doing, a court has heard.