Basic water pressure:
Water at rest will expand horizontally if able, turning a 7/7 into 3/7 and 4/7 in adjacent tiles, until it reaches equilibrium.
Water above any square of water will path towards the next available open square below itself. This teleports a square of water from the top of a cistern to an opened doorway instantly, and simulates pressure because all the water will quickly attempt to teleport to the new opening.
Diagonal movement is restricted to normal spreading habits, and water will not teleport to a diagonal square.
Thus:
#WWW#
#WWW# #
#WWW# #
#WWW #
will become
#www#
#WWW#W#
#WWW#W#
#WWWWW#
due to pressure pushing the upper most level to the next available square below itself. This does not mean a direct down path, it means any Z level below the one it currently occupies.
Also note, due to the way teleporting does not push or influence any items along the way, a highly-pressurized reservoir, when released, can leave something directly at the opening relatively untouched. Because of this, if you neutralize pressure using a diagonal, you can be more certain of pushing things, and also conserve some water as the flow will be slower and thus get more bang for the buck.
Magma will not pressurize normally, and will never path upwards of its current position. It doesn't teleport below itself. However, a screw pump breaks this rule, by putting a square of water/magma into the next available position it can path to, same as pressure in water. Thus, you CAN pressurize magma using screw pumps, and can cause artificial volcanoes, as long as your magma reservoir is above the intended volcano point.