A GFCI device does not care about the presence of a ground current -- at least not directly. GFCI measures a current imbalance between hot and neutral; if there is such an imbalance, it disconnects the circuit (i.e. it trips).
It's true that any such imbalance is most likely to flow through the ground of the GFCI's own Romex cable and for that reason it's best for GFCI circuits to be grounded. But an ungrounded GFCI will also trip if its hot current finds another path through ground, such as through a water pipe, because that current will not be returning through the GFCI's neutral and it will thus create an imbalance.
It's true that any such imbalance is most likely to flow through the ground of the GFCI's own Romex cable and for that reason it's best for GFCI circuits to be grounded. But an ungrounded GFCI will also trip if its hot current finds another path through ground, such as through a water pipe, because that current will not be returning through the GFCI's neutral and it will thus create an imbalance.