Iron and sulfur are two different elements. A mixture of iron and sulfur has separate particles that are atoms of the two elements. It is quite easy to separate the two when they are present in a mixture.
When a mixture containing iron and sulfur is heated strongly, the heat melts sulfur which then undergoes an exothermic reaction with iron to form iron sulfide. Iron sulfide is a compound of iron and sulfur. The particles of this substance are not individual atoms of iron and sulfur, they are molecules of iron sulfide. This does not allow for the iron and sulfur to be separated. Doing that requires breaking down the molecules of compound back to atoms of iron and sulfur.