Horyuji: How do you make wooden buildings that last 2,000 years?

People who built Horyuji, the oldest surviving wood structure, had unbelievably deep knowledge about wood. Better than our technology.