Dishwashers are not the most complicated machines, and you can get a good feel for how dishwashers work by simply opening up a dishwasher and having a look inside.
There are 3 main cycles involved in cleaning the dishes (similar to if you were washing by hand). The length of each cycle varies between dishwashers, and in some cases each cycle will run multiple times. The 3 cycles are as follows:
Water comes into the dishwasher through the water inlet, this water fills a basin at the bottom of the dishwasher (below the dish racks). Although dishwashers are designed to be watertight, this basin doesn't normally fill to above the level of the door.
Once this basin is full, the water is heated to around 60 degrees Celsius using a heating element in the bottom of the dishwasher. The detergent is mixed with this water through the dispenser, leaving a basin of hot soapy water ready to clean the dishes with. This mixture is generally more alkaline than if washing by hand, and hence more effective for cleaning (it would burn the hands if used when hand washing).
The heated water mixture is then pumped through to the water jets, which rotate and spray the mixture at high pressure onto the dirty dishes. There are usually 2 rotating water jets, one for the lower rack, and one for the upper rack. The spray nozzles are angled slightly so that simply spraying water out provides the sideways force needed to rotate the jets. (Newton's third law: to every action there is an equal and opposite reaction).
The water mixture then falls back down into the basin at the bottom, and is pumped back into the water jets. This process is repeated until the end of the cycle. The length of this cycle will probably be around the 50 minute mark, but may vary depending on the dishwasher manufacturer.
Once the cycle is over, the basin of dirty water is drained out. This can be done with the same pump used to move water around the dishwasher (if the pump is reversible), or (if the pump is uni-directional) this can be done by a set of valves which are activated by a solenoid.
The rinse cycle does exactly what it says on the tin. Fresh, clean water fills the basin at the bottom of the dishwasher. This water is then pumped through to the water jets, which spray the clean dishes. The purpose of this cycle is to get rid of any remaining residue from the detergent mixture.
The rinsing cycle works in exactly the same way as the wash cycle (see above), except that no detergent has been added to the water. This cycle will not last as long as the wash cycle - around 15 to 20 minutes. Once this cycle is complete, the water basin is emptied in the same way as after the wash cycle.By the time the dishwasher reaches the drying cycle, the dishes should be clean and rinsed. The most common method for drying in a dishwasher is air drying. This means using a heating element (the same one used to heat the water), to heat the air to high temperatures. The heated air will cause the dishes to dry, whilst any water from the dishes is pumped away. This cycle normally lasts around 30 minutes.