Well, you know that once you've got the bubble in between the two lines, the tube holding the liquid is completely perpendicular to the force of gravity. The only direction the bubble can move is along the axis of the tube. Once that axis is perpendicular to gravity, gravity does no work on the liquid, so the bubble stays in a fixed location. The reason the bubble moves around is because it's lighter than the liquid...
Is there something to your question that I'm missing? As far as "how level" it is... that's simply a matter of precision. They've probably got some precise manufacturing process to make sure that the ruler attached to the little tube is perfectly aligned and such.