The pressure from gravity is exerted on the mercury.
This pressure thus causes the mercury to rise to a certain
height in the measuring tube. This essentially is a vacuum,
due to how its pressure works. The tube is able to suck up
the mercury in a sense that it causes there to be a space with
no matter, due to the fact that there is no air within the upper
part of the measuring tube.