This report from Rice University covers design and economics of synthesis gas reformers.
Reaction 1: $CH_4+H_2O<->CO+3H_2$ (Steam reforming)
Reaction 2: $CO+H_2O<->CO_2+H_2$ (Water gas shift)
Reaction 3: $CH_4+3/2O_2<->2H_2O+CO$ (Combustion)
Reactions 1 & 2 are endothermic and occur in the primary reformer. Reaction 3, the combustion reaction, is exothermic and occurs along with reactions 1 and 2 in the secondary reformer.
Among many other reasons, air is not introduced in the primary reformer so that we get the most methane conversion to hydrogen with the smallest reformer possible. The link above explains sizing considerations between primary and secondary reformers.
The secondary reformer is a much simpler vessel and has the primary purpose to burn up extra methane that has slipped out of the primary reformer. The heat from the exothermic combustion reaction is recovered and used for the primary reforming.
To answer the air question from the comments, there are two ways to get nitrogen into the process. One method is using an air separation unit. The other is to put air in the secondary reformer, combust the methane and oxygen, and keep the left over nitrogen in the syngas for ammonia conversion.