The crystal chemical features of the new series of compounds R6Mg23C with R = La-Sm or Gd and Ce6Mg23Z with Z = C, Si, Ge, Sn, Pb, P, As, or Sb have been studied by means of single-crystal and powder X-ray diffraction techniques. All phases crystallize with the cubic Zr6Zn23Si prototype (cF120, space group Fm3̅m, Z = 4), a filled variant of the Th6Mn23 structure. While no Th6Mn23-type binary rare earth-magnesium compound is known to exist, the addition of a third element Z (only 3 atom %), located into the octahedral cavity of the Th6Mn23 cell (Wyckoff site 4a), stabilizes this structural arrangement and makes possible the formation of the ternary R6Mg23Z compounds. The results of both structural and topological analyses as well as of LMTO electronic structure calculations show that the interstitial element plays a crucial role in the stability of these phases, forming a strongly bonded [R6Z] octahedral moiety spaced by zeolite cage-like [Mg45] clusters. Considering these two building units, the crystal structure of these apparently complex intermetallics can be simplified to the NaCl-type topology. Moreover, a structural relationship between RMg3 and R6Mg23C compounds has been unveiled; the latter can be described as substitutional derivatives of the former. The geometrical distortions and the consequent symmetry reduction that accompany this transformation are explicitly described by means of the Bärnighausen formalism within group theory.