After effort of years, finally Sherlock with help of Microft manages to put an end to the terrorist organisation which was a threat to the world. The final step was when Jim Moriarty kills himself after seeing his terrorist empire collapsed.
Next chapter in Sherlock's life was marriage. The life partner he choose was none other than 'the woman', Irene Adler. There's a reason he saved her from being executed. For the ceremony they choose a place by the cliff. John was the best man who was with him through all the times of his life. Microft as usual choose not to attend. After the ceremony when the newly wed got into a decorated car to leave, John received a call. It was Microft. In a state of panic Microft informed John that the car driver, he is not the one hired. Something bad was going to happen. Hearing this, John ran to stop the car. But it was too late. The car had left and around the turn the car went off the cliff and exploded. The vehicle and those inside were burnt to ashes. Yet another shock, when Sherlock died in front of John. It was all in front of him so no tricks this time.
John with Mary returned back to 221B baker street. John was tensed, he was continuously mumbling, "How could he do this to me, yet again." Angrily he was punching the fireplace. Suddenly with sound a box dropped. It was old blue box. John didn't knew there was any box there. There was a small lock on the box, but it didn't took long to break through it. Inside there were photographs,Sherlock's, his younger days, when John didn't knew him. Top few were just Sherlock in his old memories, his achievements. Both looked at the photos remembering the memories of the Sherlock they knew. This was until a shocker came their way. John saw a group photo of Sherlock's friends. In the photo there was Sherlock, Irene Adler and the third was the unexpected one, Jim Moriarty. Seeing this the rest of the photos in the box dropped from his hand. This big secret was kept from him. There were lot on his mind, questions that needed to be answered.
That's when a car arrived, It was microft's. The car had come to pick them up. Through the dark windows they weren't able to see anything. They were taken to an unknown location. As they got out and head towards the only house there. At the door step there was Sherlock waiting for him, arms wide open and smiling, welcoming him. As John approached, before a hug he gave a blow to Sherlock's face. This was expected.
Later inside, after everyone got settled. Microft was there to reveal the complete truth to John and Mary. All these years, what ever happened was a part of a very big secret mission. While Microft was working in government, he acquired a secret message being circulate in the terrorist organisation. After world war 2, all the dominating countries had become weak and had to leave the colonized countries. 50-60 years hence these developing countries were rising in power. Not all were liking this. Hence many top officials had planned for a World War 3. A key role played in this was by the terrorist organisation. The officials and made arrangement to fund the terrorist organisations. Their plan was to attack the defenses of many countries, commence rivalries among the countries so that only specific Nations to could dominate if there is out break of W.W.3. Microft didn't knew who were the officials involved in this conspiracy. And there was no way to find that out. He could come up with only one solution. His younger brother, Sherlock who will work for him staying outside government. His cover as decided to be a detective consultant. But that was not enough, there was a need for someone to be deeply in the terrorist organisation . For that purpose the best choice was Jim Moriarty, equally capable and talented as Sherlock. All this was going as planed until John came. John was as they call 'A happy accident'. As Sherlock's popularity was increasing, to avoid blowing the cover of the mission all this act was planned. Sherlock-Jim's rivalry, both dying on the roof and convenient return when needed. Another piece of puzzle was Irene, the love of Sherlock Holmes. She had gone away for study purposes. When she returned and wanted to meet Sherlock. Microft stopped her as Sherlock's cover would be compromised if someone from the past came to meet him. The only way to interact if Irene assumed the identity of 'the woman'. As the story unfolded one more fact was revealed that Jim Moriarty still lives.
This was the only reason why, though there was a lot of hate-rate between these character none actually were killed because of the other. While Sherlock didn't hesitate once to eliminate the others like Magnussen.
The terrorist organised which was a threat have been neutralized so there was no recent threat of W.W. 3. for now. The top officials were still not identified but they are useless without the terrorist organisation.
After all the secrets are out, the chapter of Sherlock, the detective consultant ends here, happily. Still there were rumors of cases being solved around the world, the way Sherlock would have done. Sherlock may be gone for now but he will return if there is a threat to the world ever in the future.