They both work off the same measurement tho. The Fuel gauge is also trying to guess. How else can you explain the gauge regularly going back up as i drive more economical.
Each car is different, and to be honest, I don't know about the Z guages to understand it, but, the major contributing factor it the shape of the tank. Every car fuel tank is irregularly shaped because, let's face it, trying to fit a perfectly simetrical fuel tank in a car is never going to happen.
But they are usually bigger at the top than they are at the bottom, so if you put fuel in you will find in most cars, the first half a tank on the gauge goes down slowly, then you get your last half empty much faster. But the gauge isn't usually designed to take that into account.
Then you also add in, if your driving like a loony, just like when swirl a drink round a glass, most of the fuel is sloshing around the tank, but the reader can't compensate for that so it thinks you have less. (this was usually pretty obvious in old cars, my old escort, the fuel gauge would drop to empty when I went round a corner quickly!) When you drive normally, the fuel isn't sloshing about so you get a more accurate reading.
After all the sensor in the tank is usually just a float on the end of a rod. It's kinda like to sticking your hand in a bucket of water, you know how much water it can hold, an your friend is taking a cup of water out every few seconds, so you know that too, but you have to guess how much is actually in there, it's even harder when it's sloshing about or a funny shaped bucket.
I've typed this on my iPhone on a train, please excuse the spelling and grammatical errors.