Why were Arizona and New Mexico divided

Why were Arizona and New Mexico divided as they were