Step-by-step explanation:
An element is define as a substance which contains only those atoms which have same number of protons. Basically, an element contains atoms of one type only.
For example, a piece of sodium metal will contain only atoms of sodium.
An element can never be divided further into simpler substances. So, in the given figure box 1 is containing atoms of only blue color is an element.
A compound is a substance formed by the chemical combination of two or more different atoms present in a fixed ratio.
For example,
is a compound which contains atoms of Mg and Cl in a 1:2 ratio.
The box containing pink and yellow balls in not a compound because here atoms are not chemically combined to each other but they are just present as individual atoms in same box. Hence, this is not a compound.
Therefore, when one or more elements are in a fixed ratio joined together they form a compound.