It wouldn't "know." When it happened to be facing in the right direction it would get the extra food.
And water just happened to come forth out of its mouth for no obvious reason?...................