Peadiatric pathologist Dr Paul French told the High Court at Livingston that the child had also suffered double fractures of his thigh bone and arm.
Nyomi Fee, 29, and Rachel Fee, 32, deny killing Rachel's son Liam in a house near Glenrothes on 22 March 2014.
The couple also deny harming two other children.
The court heard that Liam, who was two-and-a-half and not growing as he should, had more than 30 external injuries including bruising to his private parts and signs of internal bleeding at various sites through his torso.
Dr French, 38, who carried out a post mortem examination on Liam two days after he was pronounced dead, told the jury that he found the sac around Liam's heart - the pericardium - was filled with 70ml of fresh blood.
"It shouldn't be there," he said. "It says there's been injury to the heart or that area that's caused that bleeding and the haemmorhage.
"That's a significant volume of blood. For a child of that age that's about 8% of the blood circulating around his body.
"That would impair the function of the heart - it would stop it being able to beat properly and would cause death."
He said he found a laceration in the wall of the child's right atrium which would have caused his "rapid death".
Similar injuries have been found in the victims of high speed road accidents, he added.
He described Liam's broken bone injuries as "quite severe" and said the large amount of bleeding in the muscle around the leg fracture could have contributed to his death.
He stressed that heart injury was the most likely cause of Liam's death but said he could not rule out that it had been caused during CPR.
Dr French said the child had a low body weight for his age, in the bottom 4% of the population according to medical charts.
He also said Liam appeared thin, with the muscles in his arms and legs less than he would expect to see in someone of his age.
He said the causes of failure to thrive were natural disease, possibly disease of the muscles, poor diet or potentially neglect.
The jury was shown post mortem photographs of the toddler's broken thigh bone.
The doctor said it was impossible to know how it was caused, apart from blunt force trauma.
He added: "This child has sustained two fracturing events to his right femur and left humerus three to five days and less than six hours before death."
The child would have been unlikely to have been able to put weight on his leg, Dr French said. He would have been crying, distressed and upset.
Liam's mother Rachel Fee and her civil partner Nyomi Fee deny murder and attempting to defeat the ends of justice by blaming the killing on another child.
They also deny a number of child neglect charges involving Liam and two other boys in their care.
The trial before Lord Burns continues.
Toddler Liam Fee suffered a ruptured heart as a result of severe "blunt force" trauma, a murder trial has been told.