Eliza was using Daniel to get inside the Palace so that she, Eliza, could know as early as possible whether King James II had a legitimate heir, and adjust her investments accordingly. This should have been as obvious as that Daniel had a big stone in his bladder, but somehow Daniel managed to finish what he was doing and go back into the coffee-house without becoming aware of either.