This looks like a question that is specific to a text or classroom lecture set of factors, so keep that in mind when reading my essay. There are more than four factors, to be sure, but if I had to select some of the more important ones in determining how a juvenile is to be treated, it would be age, nature of offense, family environment, and mental disorders.
Age - A crime committed by an 8 year old, for example, is very different from one committed by 16 year old. A 16 year old murder suspect might be tried as an adult, whereas it is very unlikely that an 8 year old would.
Nature of Offense - No differently than the adult justice system, property crimes as opposed to violent crimes would influence how a judge views and sentences a juvenile.
Family Environment - A juvenile who lives outside of the home, or in an abusive environment may be treated with more leniency or be diverted into a specific rehabilitation or therapy program depending on the situation.
Mental Disorders - As with adults, juveniles with diagnosed mental illness might also be treated differently, referred to counseling or inpatient therapy rather than juvenile detention.
If I had to pick one of these factors as the most important, it would be nature of the crime, as the main purpose of the justice system is to protect the public, and regardless of the other factors, public safety should take precedence in my opinion.