As others have pointed out, the diswasher drain line probably connects to the top of the disposal. The diswasher drain line will dump dirty water and food particles into the top of your disposal.
Do you run the disposal prior to starting the dishwasher? If you have crap built up in your disposal, that can be contributing to a backup. The manual for my dishwasher says to make sure you run the disposal at the start of a cycle.
It is possible that your disposal is clogged slightly (constricted, but not completely plugged). You wouldn't notice when you run the sink, because your are putting clean water down the drain. The dishwasher waste water includes lots of solid particles, which would aggravate the clog. Running the disposal grinds the particles and pumps the water.
There are some foaming garbage disposal cleaners, I would try one of them. Look for an actual cleaner, not just a deodorizer. (NOTE: Use something specific for disposals, not general-purpose Draino.)
Another thing to look at: Dishwashers have a built-in mechanism to deal with food particles before draining. Otherwise the hunks of food from your dishes would clog the plumbing. Most dishwashers in the US have little garbage disposal type blades that grind anything in the waste water. Some dishwashers (notably Bosch) have a little strainer basket to catch the particles. The strainer basket needs periodic cleaning.
If your dishwasher has a built-in disposal, it may not be running properly, allowing large particles to slip by.
If your dishwasher has a strainer basket, make sure the basket isn't missing and doesn't have holes in it, which would allow particles to enter the drain line.