Everything fights for survival, including the insects. Trees produce chemicals (called extractives) to deter insects and to preserve the timber from decay. These extractives can give beautiful rich colours. These extractives also affect glue adhesion and drying and stability during use.
Borer holes of various sizes and scribble marks are often found in timber to the extent where Australia has specific grading requirements for the timbers.