As with most Israelite cities, the city is eponymous to its founder or ancestor, and its population is heavily based on a family's genealogy. The city originally was called Ephrathah, where it would've been a very small town populated by his family.
It was populated by Ephrathah's family during the time of Jacob and his wife Rachel. During this period Jacob and Rachel were traveling from Bethel to the city, when Rachel went into labor for a child. As she gave birth to her son Benjamin, she passed away in labor. Jacob buried her where she died and set up a pillar, on the border of Benjamin at Zelzah.
In time, Ephrathah had a son named Hur, who had a son named Salma. Salma became the father of a son named Bethlehem. This makes Ephrathah the great grandfather of Bethlehem. Once Bethlehem had his own family, the town began to be dominated by his family. His family soon grew where the town began to be called by the dominant ancestor, Bethlehem. It was called this at least before Moses wrote the Book of Genesis.
Though the town became known as Bethlehem, sometimes the inhabitants of the city were called Ephrathites and town Bethlehem Ephrathah. Soon the city became metonymy for the clan of Bethlehem, which lived in the city. The city itself was the region in which the small clan of Bethlehem, part of the Tribe of Judah, inhabited.