Why does this circuit work with no ground?

I can't make sense out of the picture you posted, but it is certainly possible to have current flow from one output pin to another, as long as one is HIGH and the other LOW, or from Vcc to a pin that is LOW.