Infrastructure, sure. But programming, I don't see it. Reddit doesn't have to be complicated if all you want to do is make it a good link aggregation and threaded discussion site.
But Reddit got greedy, they wanted to be everything to everyone. So they kept trying to add new features to compete with other social media sites. They wanted to be Facebook and Tiktok and Imgur as well, and so they spent huge amounts of resources fiddling with their format and adding stuff like video hosting. Surprise, people already had Facebook and Tiktok and Imgur and weren't interested in something that was second-best at doing those things. So it was a huge amount of costly work that didn't end up earning them much.
This is yet another symptom of the "endless growth" problem faced by lots of modern companies. They can't settle for simply being solidly profitable in their niche. They always need to make their share price go up by getting bigger.