Explanation
According to Pascal’s principle, when pressure is applied to a confined fluid it is transmitted undiminished in all directions. When you press the bottom of a toothpaste tube, the pressure is transmitted to the top and the toothpaste comes out.