The universe's Critical Density (i.e., Critical Density of the Universe) is the density of mass across the universe that would leave it flat. The principle of General Relativity (GR) (Einstein's theory that gravitational force is equivalent to space-time reacting to mass by curving) and the models of the universe based on it (Friedmann Models) determine if the universe will "barely" expand forever (a Flat Universe, with space's expansion at exactly its escape velocity), or is expanding more than that (an Open Universe) or will eventually contract (a Closed Universe), and if a Cosmological Constant (Λ) (additional factor) is in play, how it plays into this.
The critical density shifts as the universe ages, i.e., when a distant object is observed, the critical density at the time/place of the object depends on its Redshift (z). However, if gravity is the one force controlling expansion (which is currently believed untrue, the other factor being Dark Energy) then the density of the universe remains either above or below its critical density, or at the value of the critical density current at that time.
Astrophysics determines the critical density by observation of the universe's expansion and the universe's mass, the latter by direct observation of matter and by observation of apparent local effects of Gravity on observed matter. The current estimate for the current critical density is five Hydrogen (H) atoms per cubic meter. Actual density of ordinary matter (Baryonic Mass Density) is estimated at 0.2-0.25, but a density including Dark Matter, dark energy, and other energy (e.g., Electromagnetic Radiation (EMR)) is very close to the critical density.