I've been shown "spalted" wood enough so I can ID it when I see it, but I'm not scientifically clear what it is caused by. Here goes ...
Fungi go to work at various layers in the wood ( ?why - ? moisture as Mike said, eg.)and caused the blackish discoloration. The black discoloration follows the bands of intact grain, thus the swirls and banded patterns. Many woods have the fungal action as part and parcel of the natural "history" of the wood and doesn't imply weakness or defect. Spalting can occur also in different colours, like red, pink and ? blue.
Does that make sense ? I'm not even sure if it is correct.
Cheers.