Your question is specific to the pressure change with depth in the earth. When that earth consists of soils, the lateral and vertical pressures can be calculated in a number of different ways, depending upon whether your soil is sand, or clay and whether there is ground water present. It can be quite a complex matter, as the following illustrates.
Ratio of Horizontal to Vertical Pressure
Generally speaking, in excavations, under backfilled conditions, and under foundations, horizontal pressure and vertical pressure are not considered to be equivalent, and are dependent upon soil-structure interaction, in terms of active, passive and at rest conditions.
Active conditions are where the structure is moving away from the soil (decreasing pressure on the structure). Passive conditions occur where the structure is moving towards the soil (increasing pressure on the structure) and at rest is where the soil has reached its natural state. You can imagine that all three of these conditions could be observed in a retaining structure, as it may rotate or deform during its lifetime.
Generally, most theories will provide coefficients that can be used to calculate the ratio of horizontal to vertical pressure based upon the state of the soil/structure interaction and the properties of the soils. Some are based upon Poisson's Ratio. I have even used a temperature-based Poisson's ratio to conduct an elastic analysis of horizontal and vertical pressures in bituminous pavement structures using the Boussinesq equations.
Effective Stress
Where groundwater is present the pressure is expressed in terms of effective stress, that is the difference between the total stress and the pore water pressure. This is tricky to understand but has to do with soil buoyancy and other factors.
For example, consider a point of interest 10 m below the ground surface, and uniform sands that have a natural density of 1300 kg/m3, the total stress at the 10 m depth of interest would be 130 kPa. Now consider that the free surface of the groundwater table is at a constant depth of 2 m and assume the density of water to be 1000 kg/m3. The pore pressure at the depth of 10 m would be based upon an 8 m column of water, so that the pore pressure would be 80 kPa at the depth of interest. Thus the effective stress at 10 m becomes 130 kPa - 80 kPa = 50 kPa. This is a very simplified expression as there can be lots of other factors, for example fluctuations in water level, so-called 'quicksand' conditions and for retaining structures such things as drainage, among many other considerations.
Sands (Cohesionless Soils)
For sandy (cohesionless) soils, Rankine Theory (elasticity) is often applied. For this the angle of shear resistance of the soil (friction angle) and the angle of inclination of the excavation/retaining structure becomes critical.
The friction angle of sandy soil is best measured in the laboratory, but it is also considered roughly equivalent to the natural angle of repose of the loose, dry material.
Clays (Frictionless Soils)
For soils with a cohesive element, such as clays and clay silt combinations, Coulombs (Wedge) Theory (plasticity) is commonly applied. Under this analysis, the soil is imagined as a wedge (free-body) behind the structure, and as the solution is non-determinate, the a variety of potential failure surfaces is tried until the solution converges on a maximum soil pressure.
Soils with Friction and Cohesion
Coluomb's Theory can be used on soils that exhibit both friction and cohesion. Rankine's method is not suitable for cohesive soils. However, determining the ratio of horizontal to vertical stress may require further analysis.
Often the ratio can be established by determining the states of stress as represented by a Mohr's Circle. These properties are often measured by Triaxal Shear Tests where a column of soil is tested in the laboratory under a range of confining pressures. This can establish the cohesive strength and friction angle of the material and the ratio of horizontal to vertical stress according to depth.
General Elastic Theory
There are other theoretical methods that are often used to compute the horizontal and vertical pressures beneath a point of a foundation. Commonly two methods are applied: 1) Westergaard Theory and 2) Boussinesq Theory. The ratio of horizontal to vertical pressure at some point beneath the surface is largely a function of the estimated value of Poisson's Ratio.
Westergaard Theory is elastic theory applied to layered media. This is the case in most conditions typically found in practice.
Boussinesq Theory is elastic theory applied to a homogeneous elastic half space. Whereas this may not be so applicable to all soils, it does find frequent application under simplifying assumptions.
Closure
This is just a taste of the more common analysis techniques that are used to evaluate earth pressures in excavations, under foundations and behind retaining structures. There are others, for example Log Spiral Analysis for braced excavations, which is frequently used. While the theories can be complex, when one considers the great difficulty in establishing the true composition of subsurface soil conditions (ie the existence of layers, layer thicknesses and the variability of the properties of the soils), it becomes clear that pressure/stress analysis requires a great deal of experience and skill.