It is a core belief of Latter-Day Saints, that family relationships extend beyond the grave. A Latter-Day Saint man and woman who are married in an LDS Temple by one who holds the priesthood are sealed together for eternity. A marriage performed without proper priesthood authority, ends at death.
In Gospel Principles, Page 255, first paragraph, we read:
“The atonement of Jesus Christ assures each of us that we will be resurrected and live forever. But if we are to live forever with our families in Heavenly Father’s presence, we must do all that the Savior commands us to do. This includes being baptized and receiving the ordinances of the temple.”
So what of those who have died without being baptized? Who perhaps never had the opportunity to hear the gospel of Jesus Christ on this earth. Would a just God cast them aside without ever giving them that opportunity? No. Would a loving God cast them aside? Of course not, and our Heavenly Father is loving. He loves each of to receive them after death.
He has asked worthy Latter-Day Saints to perform baptism and other ordinances, for the dead. Just to be absolutely clear, Latter-Day Saints do not actually baptize their dead. They are baptized and receive other ordinances for them, by proxy. This can be done in any Latter-Day Saint Temple.
Latter-Day Saints believe that their unbaptized ancestors are taught the Gospel of Jesus Christ in the afterlife, or spirit world. Those ancestors are still free to choose whether or not to accept the gospel, and those who do accept it are waiting for their ordinances to be performed in the Temple.
Ordinances which include not only baptism but being sealed together forever, generation upon generation.
For Latter-Day Saints, Family History is much more than a hobby, it is the key to the salvation of billions of souls, as well as to uniting that which we love dearest, our families, together.