Wreak means "to inflict or cause."

It derives from wrecan, an Old English word meaning "to avenge." Havoc comes from Anglo-French, and was originally the order shouted to soldiers when it was time to pillage or plunder a town or battlefield. These days, we use havoc to refer to a violent destruction or disturbance. So to wreak havoc on something means "to inflict or cause devastating damage."Wreak and havoc are almost always paired in contemporary English, but in 19th-century books you'll see much wreaking of ruin, toil, scorn, and other unpleasant things.

The following two examples show how the phrase refers to extensive destruction:

He also explained that, like in the movies, occasionally one or two bad dragons can come to earth and wreak havoc on the people, though most act as our protectors. (First They Killed My Father)

Industry executives said the epidemic was likely to wreak havoc on auto sales and production in the first quarter, but that it was too early to push the panic button. (Reuters)

Wreck resembles wreak, and they both have Germanic roots. But wreak refers to inflicting something terrible, while wrecking something is breaking or ruining it. Wrecking havoc makes no sense. How can you destroy destruction?

These examples show how frequently this mistake is made:

We know as well as any that even the best-intentioned child can wreck havoc on the most thought-out travel plans. (New York Times)

While predicting the precise timing of a volcanic eruption is beyond the ability of current science, an eruption at any time at Campi Flegrei would wreck havoc on the area's million inhabitants. (Time)

When you want to use this phrase, remember that when something wreaks havoc, it's not destroying destruction, but rather causing or inflicting destruction — in much the same way misused phrases can wreak havoc in your writing.