If you say to someone thank you this is in Spanish gracias. So the expression no hay de qué can be translated as You are welcome. This expression comes from the XVIII century and was used not for answering to gracias, but to other expression. Something like no hay de qué disculparse. In the XIX century this started being used as a reply to gracias.