It seems lockets evolved out of other types of jewelry, such as amulets and talismans. Initially, lockets were used to carry medicines, perfumes and other such items.
In later years, lockets became mementos that included miniature portraits of loved ones. They were ideal when at that time the only way to see the face of someone who was apart from you was by looking at a painting or drawing of them. It also became popular to keep a lock of hair in lockets as a keepsake of a loved one. In addition, lockets made excellent mourning jewelry to remember someone who had passed away.