When we give a gift, we give something that the person does not have that we hope they will like.
The gifts given by the wise men were not this type of gift. The wise men were providing Mary and Joseph with material support.
The gold, frankincense and myrrh were portable. They were easy to hide under a garment when travelling in dangerous places. The wise men have been carrying them so they could buy what they needed on their travels.
The gold, frankincense and myrrh were divisible. They could be sold one bit at time to meet their needs as they arose. They were saleable anywhere. The wise men were travelling through strange countries, so they carried wealth that could be sold wherever they went.
God knew that Mary and Joseph would need to flee, so he prompted the wise men to provide them with the necessary support. He then told Joseph in a dream, to flee to Egypt. Being a foreigner there, he would find it difficult to obtain paid employment. The same would be true when he returned to Nazareth, where he would be a stranger with no contacts.
Mary and Joseph were able to sell of the gold frankincense and myrrh one piece at time to support themselves during this unsettled time.
Thousands of sermons have been preached about the meaning of gold, frankincense and myrrh, but the most important thing is that God provides for his people. He provided material support for Mary and Joseph and their baby, before they even knew they would need it.