On the geometry of Darboux transformations for the KP hierarchy and its connection with the discrete KP hierarchy