Sam was given a single seed by Galadriel as part of the gifts she gave to the fellowship in Lothlórien. Sam planted the seed in the Shire where the great Party Tree once stood, and the seed grew into a beautiful mallorn.
"[Sam] remembered the gift of Galadriel. He brought the box out... Inside it was filled with a grey dust, soft and fine, in the middle of which was a seed, like a small nut with a silver shale... The little silver nut he planted in the Party Field where the tree had once been..."
"Spring surpassed his wildest hopes... In the Party Field a beautiful young sapling leaped up: it had silver bark and long leaves and burst into golden flowers in April. It was indeed a mallorn, and it was the wonder of the neighbourhood. In after years, as it grew in grace and beauty, it was known far and wide and people would come long journeys to see it: the only mallorn west of the Mountains and east of the Sea, and one of the finest in the world."
—excerpts from J. R. R. Tolkien's The Lord of the Rings, book six chapter 9 "The Grey Havens"