The LORD compensated Job generously for all he had lost because of his trial, doubling what he had before: twice as many sheep, camels, oxen, female donkeys, he received a further seven sons and three daughters (presumably the first ones were now in heaven, so they weren't lost), and he lived an additional one hundred and forty years (if the proportion was kept, he would have been 140 years old when calamity struck).
His three daughters were exceptionally beautiful, which is a reflection of the meaning of their names: Jemimah (dove), Keziah (cassia, a fragrant cinnamon bark) and Keren-Happuch (horn of eye make-up). They were given an inheritance with their brothers, something probably uncommon in their time.
The LORD blessed Job more in the latter days than at the beginning. And so Job died old and full of days.
The Lord Jesus said that anyone who gives up something for the kingdom of God will be repaid handsomely (Luke 18:29, 30). Our restoration may not be of the same kind and proportion as Job's, which was both spiritual and material.
Our complete restoration may not be in this life -- but it will happen. God loves us, and he is just. He not only will restore whatever we have lost unjustly, but he also will give us more than we can imagine as we live with him in eternity.
There is also a reward for those who use their talents wisely in the furtherance of His kingdom on earth and those who cling tightly to their faith through all their trials.
We are not told if the reason for his trial was revealed to Job before he died. It would certainly have been revealed to the writer of the book but we don't know if it was written in his lifetime.
There are many things which happen in this world, including God's people, the reason for which is a mystery not unveiled during the lifetime of those who experience them. We must learn from this book to be patient and trust the omnipotent and omniscient God to carry out his wise and righteous purposes. We may rest in our trust in Him.
10 And the LORD restored Job's losses when he prayed for his friends. Indeed the LORD gave Job twice as much as he had before.
11 Then all his brothers, all his sisters, and all those who had been his acquaintances before, came to him and ate food with him in his house; and they consoled him and comforted him for all the adversity that the LORD had brought upon him. Each one gave him a piece of silver and each a ring of gold.
12 Now the LORD blessed the latter days of Job more than his beginning; for he had fourteen thousand sheep, six thousand camels, one thousand yoke of oxen, and one thousand female donkeys.
13 He also had seven sons and three daughters.
14 And he called the name of the first Jemimah, the name of the second Keziah, and the name of the third Keren-Happuch.
15 In all the land were found no women so beautiful as the daughters of Job; and their father gave them an inheritance among their brothers.
16 After this Job lived one hundred and forty years, and saw his children and grandchildren for four generations.
17 So Job died, old and full of days.