The original story can be found in Matthew 2. After Jesus was born, “behold, there came wise men from the east to Jerusalem”. They had seen a star that they considered indicative of the birth of the King of the Jews and had come to Jerusalem to find the child. When king Herod heard of their search, he wanted to know more about this possible competitor. His priests and scribes told him that such a king was to be born in Bethlehem, according to Micah’s prophecy. Herod now sent for the three wise men and told them to go to Bethlehem and report their findings to him.
This Herod was in fact King Herod I, a.k.a. Herod the Great, tetrarch of Judea, who lived approx. from BC 73 to 4, and who governed the Judea region under Roman rule. He was not very popular among the Jewish population, mostly due to his attempts to enforce a Hellenistic culture. Traces of these attempts can be found in the ruins of Caesarea, the harbour city that Herod had built. Herod considered himself King of the Jews as well, although according to Jewish law he was not even Jewish.
The star guided the three men to Bethlehem where they discovered the child in the house the star stood over. The men offered the child their gifts: gold, incense and myrrh (a resin with a pleasant smell). This event is known as the Adoration of the Magi. That night, God told them in their dreams to ignore Herod’s orders. The next day the Magi departed, avoiding Jerusalem on their way home.
When Herod learned that the wise men had deceived him, he saw no other option than to have all Bethlehem children under the age of three murdered. Jesus and his parents had already escaped to Egypt: Joseph had been warned by an angel, also in a dream.
So the three kings (Tradition tells us their names where Balthasar, the black Caspar and Melchior) not only brought gifts, but also helped to save the child. In addition to the mysterious guiding star the subject matter couldn’t fail but to inspire numerous painters.