The largest clusters of galaxies in the Universe contain vast amounts of dark matter, plus baryonic matter in two principal phases, a majority hot gas component and a minority cold stellar phase comprising stars, compact objects, and low-temperature gas. Hydrodynamic simulations indicate that the highest-mass systems retain the cosmic fraction of baryons, a natural consequence of which is anti-correlation between the masses of hot gas and stars within dark matter halos of fixed total mass. We report observational detection of this anti-correlation based on 4 elements of a 9 × 9-element covariance matrix for nine cluster properties, measured from multi-wavelength observations of 41 clusters from the Local Cluster Substructure Survey. These clusters were selected using explicit and quantitative selection rules that were then encoded in our hierarchical Bayesian model. Our detection of anti-correlation is consistent with predictions from contemporary hydrodynamic cosmological simulations that were not tuned to reproduce this signal.