Compression wood forms on the side of the plant that is under compression, thereby lengthening/straightening the bend.
When wood is compressed, it develops a bend along the side that's being squeezed, which causes it to lengthen or straighten.