Good point. I've never used a custom tileset before, so I didn't know.
To that end, how does turning fluid levels on differentiate between the ~ and ~~ graphics when it comes to sand vs. water? I would think that the coding would have to specify that fluid level numbers replace only water, not the entire set of ~ and ~~ characters on the map. Although the entities certainly need to be specified for changes within the tileset, I would think that there would need to be differentiations with other things too, like sand vs. water, stone vs. dirt, wall vs. miasma, etc.
Turning on fluid levels doesn't change every ~ and ~~ into a number, it specifically replaces water and magma tiles with the numbers. The tilesets are just basically a skin, that styles the output coming from the dwarf fortress exe, but doesn't do anything to change the way the game works.
There
are a couple tilesets that use a very nearly identical tile for ~ and ~~, which annoys me no end as it makes discerning magma pools and magma pipes nearly impossible, but it's not an innate aspect of all tilesets, those particular tilemakers simply chose to use a very similar graphic for both characters. Tilesets replace characters on a 1 for 1 basis, there is no information lost, or gained, unless two tiles in the tileset are too similar in appearance.
Graphic sets do add some information, since they directly replace a creature, not it's character. So it's possible to tell the difference between camels and children for instance. (or was it camels and cats?)
Some tileset authors also include modded raws to change what particular character represents a particular type of stone, but that's really more a matter of bundling a mod and a tileset, since you could easily delete their tileset graphic, and still see the switched characters for each stone, even with the default graphics. RantingRodent's set uses this quite well actually, sorting the stones and gems by value and type, then assigning a visibly different tile to each, which does make it much much easier to quickly identify what stone is what without using the loo'k' command.