Wikipedia has a good article on Dishwashers.
Salt, Rinse Aid & Detergent all play their part in efficient washing.
The detergent and the heat sometimes cause cloudy hazing on glassware - permanent & impossible to remove.
Debris stuck to the dishes is just broken down food particles (sometimes small pieces of lime-scale too) baked on during the drying process because of lack of rinse aid.
Peccavi
September 2010