St. Nicholas used to give poor people presents anonymously. Like a burglar, his breaking-and-entering tricks he probably kept secret, so people had to make up a story for the children.  I can guess that eventually he was found out, or there would be no legend!