Before heating, the magnesium fillings and sulfur powder were separate as they did not combine when they were simply mixed together at room temperature and could be separated by physical means. But when heated, the atoms of both combined at an atomic level, with strong ionic bonds between them, and thus turned into a compound from a mixture. ( $Mg + S \longrightarrow MgS$)
Work Step by Step
When Sulfur (S) powder and magnesium (Mg) fillings are mixed together, they form a mixture. This is because the sulfur and magnesium do no react with each other at room temperature. But when they are heated, they form a compound called magnesium sulfide (MgS) ( $Mg + S \longrightarrow MgS$) The mixture when heated turned into a compound, as the atoms of magnesium and sulfur combined with each other at an atomic level. Previously, the magnesium fillings and the sulfur powder could be separated by physical means. But in compounds the atoms are bound by very strong forces and this can no longer be done.