Magi, wise men from the lands east of Israel, had come to see the young King. They had not known exactly where to find him. Signs and stars and ancient texts had directed them to this land. And a brief visit with the King Herod had narrowed down their focus.
I'm sure both Joseph and Mary were surprised, but courteous. The Magi had brought gifts suitable for a King, though perhaps not very useful for a toddler. Gold. Frankincense. Myrrh.
After their departure, the couple no doubt discussed this oddity. But there was work to be done, a child to raise, and meals to be served. That night, though, Joseph had a dream.
You have to realize that every time Joseph had a dream which involved an angelic visitation, it was a very important message from the Most High God. Joseph was to take his family and move them south to Egypt, a foreign land which worshiped other gods. There he was to stay until God dealt with King Herod, who had murderous intentions, and Joseph was told to return.
Joseph got up immediately. We're talking the middle of the night. You know how you wake up right after a particularly vivid dream? Joseph woke up, got up, packed his family up, and they were gone by morning. That is some serious obedience!
Having moved many times in my life, I know making a big move is always a bit nervewracking. You have to find a new place to live. Perhaps obtain new things for your home that you didn't necessarily need at the former place. Someone will have to become employed.
But the Lord God had just provisioned them with the resources they would need to live in Egypt for a few years.
Gold was considered the "skin of the gods." It was extremely valuable, especially to provide kings with what they would need for the afterlife. Gold was needed for royal coffins and the funerary pieces they would need for an eternity. The Egyptians took preparations for the afterlife very seriously, and it was important to do everything right.
Even more valuable were the myrrh and frankincense.
Myrrh was also a valuable aromatic and the Egyptians purchased it by the boatload. It was used for incense, in insect repellents (they lived right by the Nile, remember), as perfume, and in healing salves. But most importantly, it was a key ingredient in the embalming process.
God, in his foreknowledge and love, provided Joseph with just what was needed to comfortably provide and care for his family in a foreign land.
"But my God shall supply all your need, according to His riches in glory by Christ Jesus!" - Phil. 4:19 KJV