Its actually derived from the continuity equation (essentially material balance) along with Ficks first law.

Darcy equation and EOS etc are then layered on top to create the equations required for numerical modeling