The claim is that Mary nursed Jesus in this cave prior to their flight into Egypt. It is also claimed that this is where Joseph had the dream warning them to escape to Egypt and that this might have been the family's home, where the Magi visited Jesus.
Clearly Mary nursed Jesus, Jospeh had that dream and the Magi did visit but there is no biblical reference to this cave.
I suspect a lot of the tradition is influenced by the Roman Catholic Church's adoration of Mary.