It is most likely that the tradition of Santa's cookies and milk stems from the medieval German custom of the "paradise tree." Other thoughts are that it is linked to the Great Depression, Norse mythology or Saint Nicholas himself.
A paradise tree was used by families in medieval Germany, and was decorated with apples, wafers and cookies. When this tradition merged with Christianity's customs, many families chose to continue decorating the Christmas tree with edible items. Eventually, the tradition moved from putting the food on the tree to leaving it on a table by the fireplace to be more convenient for Santa to snack. Milk was integrated with the snack since it is a beverage that naturally melds well with cookies.
The cookies and milk tradition may be linked to the Great Depression as well. It is simply a way of teaching the children that it is important to share, even when times might be hard. In Norse mythology, the Norse god Odin rode an eight-legged horse named Sleipner. He visited children during the Yule period, so the families left snacks out to entice him to visit their home. The feast of Saint Nicholas is on December 6th, and it may be possible that Santa's cookies and milk tradition stems from St. Nick's celebration. Children traditionally left St. Nick treats in exchange for presents the next day.