An aquifer is one or more layers of rocks that spew water in all four horizontal directions, as well as down, if there is empty space there.
Aquifers are discussed in depth here: Aquifers
There are seven or eight methods of dealing with aquifers discussed there.
In addition, the Double Slit method is one of the more straightforward, though painstaking, methods for dealing with any aquifer: Double Slit Method
The Double Slit method uses pumps to pump water from one side of your work site, draining excess water into other aquifer blocks, while miners dig out the walls around the work site, and masons or carpenters then wall off those dug out sections. After each layer of the aquifer is secured, the next lower layer is probed, and, if there's another layer of the aquifer, the same process is repeated. Once the bottom of the aquifer layers has been found, a slightly different draining procedure is used to secure the lowest aquifer layer.