The distinction is subtle, and it's even possible that it's only illusory, but in the examples given by Cambridge it seems that "wracked by" is followed by the agent of ruin whereas "wracked with" is followed by the content of agony.
So we have:
- "wracked by civil war"
- "wracked by a titanic struggle"
- "wracked by communal riots"
In these examples, the agent may not be a part of the result -- the war and rioting may be over, but the ruin remains.
On the other hand:
- "wracked with pain"
- "wracked with rheumatism"
Here, but for the pain and sickness there would be a whole person.
This example shows the weakness of the distinction. "Wracked with famine" sounds identical, but then again, famine is the cause of famine...
In your example, I would probably use "wracked with grief" to describe someone who was currently grieving and "wracked by grief" to describe someone, say, whose life had been destroyed by past grief.