The fact of Budapest being a rich city is not a surprising one because it was the capital of Hungary that was many times larger than today's Hungary, spreading from Split to Lemberg - to be reduced to "ethnic quarter" of Magyars after WWI. And every monarchy is a very center-leaning entity so the capital would concentrate wealth of the entire - much bigger than today - nation. It was a co-capital of Habsburg Empire on the same rights as Vienna.