The first reference to peanut butter joining with jelly in sandwich matrimony was in a 1901 recipe by Julia Chandler Davis in the Boston Cooking School magazine. During the early 1900s, peanut butter was an expensive delicacy, served in upscale tearooms. (One place even had a peanut butter and pimento sandwich.) As the price of peanut butter fell due to commercialization, the food moved down the economic class ladder and became an everyday treat for everyone. When sliced bread was invented in 1928, the peanut butter and jelly sandwich became a kids' favorite because they could make it themselves.
So why are peanut butter and jelly so good together? In the book "Peanuts: The Illustrious History of the Goober Pea," Andrew F. Smith points out that peanut butter is a "relatively neutral platform providing a nutty taste and a sticky texture that [binds] together various ingredients." And jelly can be relatively tart, providing a nice counterpoint. All you need is some soft bread to complete the taste perfection.