A very simplified explanation, depending on each airline basically computers work out how much fuel to take they know the engine fuel burn rate for each particular A/C the winds are entered and the departure, destination and alternate airfields, finally the ZFW is entered.
It's then basically worked out backwards ie the A/C is on the ground at it's alternate with 30 Min's of fuel on board at the estimated ZFW, this is a start point as the A/C is a known weight. Fuel is then added as the A/C goes backwards from the landing at the alternate backwards to the destination where a Go around was performed (5% contingency may be added to the diversion fuel) this point is also the diversion fuel requirement or reserve/alternate fuel which is then basically fixed. Fuel then continues to be added as the A/C continues backward through the descent to destination from whatever the optimum altitude is at that weight and wind, then backwards through the cruise and step climbs, and finally the climb from take off from the departure airfield, where another 5% contingency is added.
So during flight contingency fuel reduces and reserve/alternate fuel effectively remains fixed.
So now you know how much fuel you need to get there, but this fuel figure may be adjusted due to weather or change in ZFW at the Captains discretion, which there are various ways to account for the new fuel burn without getting a new flight plan.
Also it can become a fine balance between the ZFW entered resulting in a MTOW flightplan, it will be able to produce the MZFW on the information entered.
[Edited 2006-02-26 23:24:46]
P1 in A330, A340, A346, B742, B744, B748.