This is a pun on the word "stave". To stave off hunger means to keep from going hungry. A "stave" is a wooden part of a barrel. The termites are eating a stave so they can stave off hunger.  
Why did the termites eat the wooden barrel ? To stave off hunger .