While they were captives in Babylon, the Hebrews needed hope and some priests and writers provided that. They took the written and oral legends and mixed in some well-founded names the likes of King David, they embellished and stole from other legends and wrote and re-wrote. I gotta imagine that up until that time, the legends were pretty much no different to the Hebrews than GOLDILOCKS AND THE THREE BEARS or SNOW WHITE were to people today.
With an attempt to remove the multitude of gods and an all-out insistence that their forefathers relied on the one god, the god of Abraham, and pretending that the Hebrews used to live under a law code from that God and had a grand past, the legends became more of a history than the fairy tales they were at first.
Even when Rome ruled over the Hebrews, nobody was living under that law code. Nobody ever did. But the priests kept saying the people did so in the past. When Jerusalem was lost in the year 70 AD, it cemented their past in the Bible, giving this group of Palastinians a reason to feel superior to other Palastinians.
Other legends were growing in popularity before 70 AD. There were various anointed ones, some real rebels and some just legends. One "anointed one" or "messiah" story stuck pretty good thanks to a Hebrew named Saul/Paul who probably believed that writing of this legend would give hope and solidarity to the people just as the priests had done before in the past.
People in those days before 70 AD probably knew the stories were just legends. It may have even been part of a winking society to pretend in the validity of the stories in the face of Roman authority over them- a secret way of defying Ceasar.
The legends grew after 70 AD and within 150 years, pretty much everyone who repeated them but knew they were just stories was gone. Rome, against much common sense, in an effort to consolidate the Pagans under their control, used the belief in these stories and incorporated it into competing stories and made it the official belief of the empire. This was at a time when belief in the pantheon of gods was dying anyway. That move to take Christianity was probably similar to Rutherford seizing the Watchtower, instead of letting it die a peaceful death after it lost it's leader.
Plenty of bumps in my theory that would need smoothing out, but I stand by it generally- especially the part that NO LARGE GROUP EVER LIVED BY THE MOSAIC LAW CODE. I also differ with many who feel that there was a "Jesus." It's possible, but I feel it is way more likely that he was created as a legend by combining stories of other would-be messiahs of the time. People heard of Paul's writings and created a "Jesus" to be larger than life.