Thereby means “as a result of”. It is the effect of a cause, in one sense. If one were to take medication we could say the medication acts on the x receptor, thereby reduces lipids in the blood stream.
There is a subtle difference between these two. In this way relates back to a process or thought, for example. It can be used to restate a subject in a sentence more cleanly.
“The student tried to use his family connections to circumvent academic suspension. The student cannot be allowed to sidestep punishment in this way.”
Does that make sense?