2 Chronicles 34:27
Because your heart was responsive and you humbled yourself before God when you heard what he spoke against this place and its people, and because you humbled yourself before me and tore your robes and wept in my presence, I have heard you, declares the LORD.
This is good King Josiah. Between him and good King Hezekiah was the bad King Manasseh in chapter 33. The interesting thing I find about him is that he did start out very bad, undoing all of Hezekiah's reforms and re-establishing idol worship, but then he made a turnaround. After being taken away to Babylon, shackled, hook in nose, he humbled himself and pleaded with God. My thought is, who wouldn't? God's mercy is dazzling. With no details given, Manasseh returned to Jerusalem and showed himself a changed man, reversing much of the pagan worship he'd brought in himself.
His son, another bad king, was so bad that he got only two years.
And that is the background for this, Josiah's responsive heart. Again, I find the sequence of events very intriguing. Josiah was the boy king, only eight when he started. At sixteen, he began to seek the Lord. At twenty he went out and purified the land physically as Hezekiah had. Six years later he began to repair the Temple. This work went well, but it was only as they brought out money from the Temple that the Book of the Law turned up. In the same afterthought way, Shaphan brought Josiah an update on the Temple work and the finances, and then, oh yes, they found this book.
How did Josiah know where to start without the Book, without even knowing it existed? God Himself must have led him...
I picture these elite men of Judah, staring for a few minutes at a dusty scroll, knowing before they opened it that it was worth more than all the silver and gold, more than the whole Temple, that it was the very Word of God. And when the good king heard the words, he tore his robes.
Josiah's reward was for him and his generation--(v.28) "Now I will gather you to your fathers, and you will be buried in peace. Your eyes will not see all the disaster I am going to bring on this place and on those who live here." There wasn't enough mercy for the future idolaters, who would indeed live through disaster.