The Iraqi-born teenager is said to have prepared the attack while his foster parents were away on holiday between September 1 and September 8 a year ago.
Prosecutor Alison Morgan told jurors it was just "a matter of luck" that the bomb did not fully detonate and people were not killed.
He has denied charges of attempted murder and causing an explosion likely to endanger life.
"Had the device fully detonated, it is inevitable that serious injury and significant damage would have been caused within that carriage".
Mr Hassan was placed with the couple after arriving in Britain in the back of a lorry via the Channel Tunnel in October 2015.
He said he was recruited on his own and trained with 1,000 people until Iraqi soldiers came into IS territory and told everyone to go.
Months after the interview, a Barnado's staff member who spoke Arabic allegedly caught him listening to an Islamic nasheed [song], with words to the effect of: "We are coming with you to the slaughter in your home/country".
There were 93 people in the carriage where the bomb was planted during the morning rush hour in September a year ago, the court has heard.
Ambulances and police nearby after an incident on a tube train at Parsons Green subway station in London, Friday, Sept. 15, 2017.More news: France to set legal age of sexual consent as 15
More news: Tripura debacle revives debate in CPM on anti-BJP alliances
More news: Rams are trading OLB Robert Quinn to Dolphins for draft pick
It was stated that the defendant got off the carriage at Putney Bridge Station before the bomb went off and he was arrested at the Port of Dover the following day.
There were 93 people in the packed Tube carriage when the device partially exploded in at 8.20am, sending a fireball into the air and severely burning commuters. He could have pulled the wires out of the device.
An expert concluded there were several reasons why the bomb only partially exploded.
CCTV footage from close to Hassan's home in Sunbury on the day of the attack appeared to show him leaving through the back garden at around 7am, carrying a Lidl bag.
Jurors heard details of the injuries suffered by people on the train, which included burns to their faces and bodies.
They included the initiator coming loose when it was transported or poor construction, the court heard.
"The prosecution therefore alleges that the defendant intended that this should be a lethal attack".
One of the survivors, identified in court only as Miss S, became distressed as she described how her clothes caught fire after she was caught in the blast, while a second, Lucinda Glazebrook, began to weep as she was being assisted into the witness box at the Old Bailey.
Stephen Nash noticed a "blinding light and the feeling that he was in a furnace engulfed in flames", the court was told.
He researched online how to make explosives, ordering an ingredient on Amazon, and bought screwdrivers, knives and nails for shrapnel from supermarkets.