An artesian aquifer is a confined aquifer containing groundwater that will flow upwards through a well without the need for pumping. Water may even spurt out of the ground if the natural pressure is high enough. An aquifer provides the water for an artesian well. An aquifer is a layer of soft rock, like limestone or sandstone, that absorbs water from an inlet path. Porous stone is confined between impermeable rocks or clay. This keeps the pressure high, so when the water finds an outlet, it overcomes gravity and goes up instead of down.
In recharging aquifers, this happens because the water table at its recharge zone is at a higher elevation than the head of the well.
"Fossil water" aquifers can also be artesian if they are under sufficient pressure from the surrounding rocks. This is similar to how many newly tapped oil wells are pressurized.