I'm sorry to say we don't know for sure, there is nothing definitive in the books so far, so much of what follows is speculation on my part based on what little lore we do get in the novels.
In the books, the original Night's King was supposedly the 13th Lord Commander of the Night's Watch who fell in love with what was probably a female Other (White Walker in the show). She is described as having "skin as white as the moon and eyes like blue stars" and her skin was cold as ice, and we're told he "gave her his seed".
It's suggested the Night's King and his Queen made sacrifices to the Others, which sounds very reminiscent of Craster. We're never told who was sacrificed or how, maybe it was NK's own children, this might even explain the Night's Watch vow to sire no children. His castle was the Nightfort, which has a creepy magical Weirwood door called the Black Gate beneath it. This gate leads to North of the Wall, very useful for carrying babies beyond the Wall's protections, and when you pass through it the door's mouth grows until it swallows, almost like you're being consumed by the Old Gods.
It's possible this practice of sacrificing to the Others was passed down through the generations. There is some suggestion that the knowledge of sacrificing to the Others exists on the periphery of Northern society. The Wildlings seem to think Others steal their children and a common insult in the North is "The Other's take you". If this was a common practice which is dying out now that Mance has unified the Wildlings and made them stronger, that might explain why the Others have returned. If they need the children of men to convert in order to exist, and they're now only getting a handful from Craster, perhaps they're taking a more direct approach.
Alternatively, it's possible that the practice was only recently rediscovered, which might also explain the Others' return. There is some suggestion that Craster is a descendant of the original pairing of Night's King and Queen. People say of him that he has black blood and has a cold smell to him and that he appears less than human. If Craster has the blood of the Others then this might also explain his incest, as a means of purifying that blood for them, of not diluting it (a parallel to the Targaryen practice of incest, also intended for the same purpose).
His name might also have originally come from a mangled form of "Stark", like the Karstarks, and since there's a non-zero possibility that the original Night's King was also a Stark, perhaps the name passed down and eventually became Craster. If Craster is really a descendant of this pairing then him knowing of the sacrifices or working it out by some piece of familial knowledge passed down through the generations may explain how he came to be sacrificing his children.
Interestingly, Gilly's baby is nicknamed "Monster" in the novels, which might be foreshadowing if the baby has the blood of the Others. Especially since the baby is at the Wall and everyone believes it to be the child of Mance, King in the North. Melisandre is also at the Wall. I'm not sure the Others will be too happy if one of their blood kin was sacrificed as an offering to R'hllor.