We have reexamined the origin of the apparent differentiation between nitro
gen-bearing molecules and complex oxygen-bearing molecules that is observed
in hot molecular cores associated with massive protostars. Observations sh
ow that methanol is an ubiquitous and abundant component of protostellar ic
es. Recent observations suggest that ammonia may constitute an appreciable
fraction of the ices toward some sources. In contrast to previous theories
that suggested that N/O differentiation was caused by an anticorrelation be
tween methanol and ammonia in the precursor grain mantles, we show that the
presence of ammonia in mantles and the core temperature are key quantities
in determining N/O differentiation. Calculations are presented which show
that when large amounts of ammonia are evaporated alkyl cation transfer rea
ctions are suppressed and the abundances of complex O-bearing organic molec
ules greatly reduced. Cooler cores (100 K) eventually evolve to an oxygen-r
ich chemical state similar to that attained when no ammonia was injected, b
ut on a timescale that is an order of magnitude longer (similar to 10(5) yr
). Hotter cores (300 K) never evolve an O-rich chemistry unless ammonia is
almost absent from the mantles. In this latter case, a complex O-rich chemi
stry develops on a timescale of similar to 10(4) yr, as in previous models,
but disappears in about 2 X 10(5) yr, after which time the core is rich in
NH3, HCN, and other N-bearing molecules. There are thus two ways in which
N-rich cores can occur. We briefly discuss the implications for the determi
nation of hot-core ages and for explaining N/O differentiation in several w
ell-studied sources.