We know the Templars existed, but how exactly they came to be is up for debate. In The Real History Behind the Templars, the author states that the Syrian patriarch, Michael, gave one of the first versions of the Templar story. In 1190, Michael wrote that a man from France traveled to Jerusalem with 30 knights to devote his life to God. But the group of traveling knights were so impressive in battle that the king asked the group to stay in Jerusalem and fight against their enemies. And so, the Templars were born. But Walter Map told a different origin story. According to Map, the Knight Payns traveled from France to Jerusalem, and when he heard that Christians were often attacked by pagans in the city, he decided to stay and fight them off. Payns was a one-man fighting machine, a Chuck Norris for the Lord.
If you asked a monk named Bernard, he'd give you yet another tale. In 1232, he wrote that a group of pilgrims moved to Jerusalem, got tired of just standing around and praying, and formed a group of knights to fight for the Christian way. But the most likely story comes from William, the Archbishop of Tyre. He recalled that Hugh of Payns and Godfrey of St. Omer came to Jerusalem to offer their services to God. Their main tasks were to keep the roads safe and protect the pilgrims from attackers. All versions agree that the Templars first lived on the holy site where Jesus was buried before staying at the palace of King Baldwin II. Whether they started with one dude stomping out pagans or a group of knights that swore themselves to the Lord, either way, the origins aren't very mystical. It was definitely some knights who decided to stay in Jerusalem, still as knights.