Answer
As explained in this Outside Story essay, these cubes are the result of brown rot fungi, which, as author Rachel Sargent Mirus explains, “consume the cellulose and hemicellulose, snipping those molecules down to their component sugars, which the fungi then absorb. Brown lignin is left behind, and the decayed wood tends to crack into cubes, which eventually crumble into fine particles that are an important water-retaining component of forest soils.”