During wartime, the major driver of inflation is aggregate demand.
We must remember that aggregate demand does not simply include civilian spending. Instead, it covers government spending as well. During a major war such as World War II, the government is spending tremendous amounts of money. The government needs to buy huge amounts of war materiel such as ammunition. It must also buy large amounts of food and clothing and other things that are needed for the soldiers. Because of all of this government spending, there is an increase in aggregate demand. When aggregate demand increases there will, all other things being equal, be inflation.