Iron has an oxidation state of +2 or +3. What determines the oxidation state in compounds?

This is a rather broad question, but to be brief: the oxidation state of iron in a compound depends on how strong the oxidizing properties of the substance interacting with iron will be. The stronger the reagent, the higher the oxidation state.
For example: 2Fe + 3F2 = 2FeF3 (fluorine is a very strong oxidizing agent, therefore it oxidizes iron to +3.) Fe + H2S = FeS + H2 (hydrogen sulfide acid is not a particularly strong oxidizing agent, therefore it only oxidizes iron to +2).



One of the components of a person's success in our time is receiving modern high-quality education, mastering the knowledge, skills and abilities necessary for life in society. A person today needs to study almost all his life, mastering everything new and new, acquiring the necessary professional qualities.