The Night King and white walkers come about at different times. It was Brandon the Builder and the children of the forest who combined their forces to defeat the white walkers during the first long night. After Bran the Builder and the Children of the Forest built the Wall. The Night King who was also the 13th Commander of the Nights Watch and a Stark became the Night King after he fell in love with a female white walker.
“According to legend, Night's King lived during the
Age of Heroes, not long after the
Wall was complete. He was a fearless warrior named the thirteenth
Lord Commander of the Night's Watch. Later, he fell in love with a woman "with skin as white as the moon and eyes like blue stars". He chased her and loved her though "her skin was cold as ice", and when he gave his seed to her he gave his soul as well. Night's King brought her back to the
Nightfort and after the unholy union, he declared himself king and her his queen, and ruled the Nightfort as his own castle for thirteen years.”
“During the dark years of his reign, horrific atrocities were committed, of which tales are still told in the
north. It was not until
Brandon the Breaker, the
King of Winter, and
Joramun, the
King-Beyond-the-Wall, joined forces that Night's King was brought down and the Night's Watch freed.
[2] After his fall, when it was discovered that Night's King had been making sacrifices to the
Others, all records of him were destroyed and his very name was forbidden and forgotten.
[1]It is likely this led the lords of the north to forbid the Night's Watch to construct walls at their keeps, ensuring the keeps would always be accessible from the south.” The Others are the White Walkers.