The natural durability of wood is related to the extractives it contains. Certain species have the ability to produce some product classes (extractives) which give high natural durability your wood, while others don't have this same ability.
Natural Durability is the ability of timber has to remain healthy for several years in service without the need for application of chemicals.
I suggest you read the third chapter of the e-book available at the link below. This chapter (from page 53) deals with the chemical composition of wood and features a number of extractives that make up the wood and prevents the attack of some degrading agents.
Several factors influence the durability of the interior parts of standing stems. The presence of heartwood extractives that are toxic for wood destroying fungi is only one aspect. If this was the only answer we would never find a hollow black locust (Robinia) and for example beech would always be severely attacked by fungi already in the standing tree. In reality the durable heartwood of black locust is often attacked by fungi whereas the absolutely non-durable beechwood is attacked less often (I am only talking about the standing tree – after felling the situation is completely different). The ability of the different trees to prevent the ingress of fungi into the interior is as least as important as the durability of the wood. In the case of willow it might even be speculated that being hollow and therefore collapsing rather young might be an advantage. Willow is often distributed by vegetative propagation. Maybe the early collapse increases the chance for a better propagation.
Maybe the article of Shigo (see link below) is helpful: