There are more factors at play here but the tldr is that, other than wheat, rye flour contains a very high level of amylase, an enzyme that breaks starches into sugars. Amylase prevents bread from rising, and rye contains so much of it that it stays active even with the high temperatures of baking. Add that to the fact that rye has very little gluten to hold up the structure of the bread…
That‘s where sourdough comes into play. The acids produced during a slow fermentation slow down the reaction of amylase, giving you a lighter bread. For a good rye bread, I ferment for over 24h in three steps.