wrack (n.)
late 14c., "wrecked ship, shipwreck," probably from Middle Dutch wrak "wreck," from Proto-Germanic *wrakaz-, from root *wreg- "to push, shove drive" (see wreak). The root sense perhaps is "that which is cast ashore." Sense perhaps influenced by Old English wræc "misery, punishment," and wrecan "to punish, drive out" (source of modern wreak). The meaning "damage, disaster, destruction" (in wrack and ruin) is from c.1400, from the Old English word, but conformed in spelling to this one. Sense of "seaweed, etc., cast up on shore" is recorded from 1510s, probably an alteration of wreck (n.) in this sense (mid-15c.). Wrack, wreck, rack and wretch were utterly tangled in spelling and somewhat in sense in Middle and early modern English.
wrack (v.)
"to ruin or wreck" (originally of ships), 1560s, from earlier intransitive sense "to be shipwrecked" (late 15c.), from wrack (n.). Often confused in this sense since 16c. with rack (v.) in the sense of "torture on the rack;" to wrack one's brains is thus erroneous. Related: Wracked; wracking.