I'm going to put the whole SC question here, so that the answer makes better sense.
Compared to those who do not, running three days a week saves an average of 14.1 percent on health-care costs each year in the United States.
A. Compared to those who do not, running three days a week saves
B. Compared with nonrunners, people who run three days a week save
C. Compared to not running, those running for three days a week save
D. When compared with those who do not, people running three days a week save
E. When compared to nonrunners, running three days a week saves
I see that you eliminated A, C, and E. Good. Each of those makes an illogical comparison: A compares "those" to "running"; C compares "not running" to "those"; and E compares "nonrunners" to "running."
Your question is about B and D. On SC questions, take "when" literally. D means that
while people running are compared to those who do not run, people running save 14.1 percent. Presumably, when you stop comparing them, the savings vanish. There are two related reasons this is hard to spot here. First, in ordinary informal speech, we're not so strict. Second, we're inclined to be charitable when reading such sentences, since the literal meaning is rubbish.
To your second question, "what's the difference between compare to and compare with?"
On the GMAT, no difference. Most authorities note a difference in Standard Written English (see, e.g.,
https://www.e-education.psu.edu/styleforstudents/c3_p21.html) but surprisingly the GMAT ignores that. Don't try to choose on that basis.