The writer speaks of a parent using any form of discipline as if that parent were hitting the child with a wooden rod. (See: [[rc://en/ta/man/translate/figs-metonymy]])
The writer speaks as if foolishness were a person that another person could use a physical rod to drive away. AT: "will make a child wise" (See: [[rc://en/ta/man/translate/figs-metaphor]])