Everything in this creation is made up of the grouping (Gana) of these five elements. For example, the Water element has many diverse forms, like milk, curd, etc.
In the same way, the Air element is not of one kind alone. You can see that there are so many different gases like carbon-dioxide, oxygen, and nitrogen, etc. So this group (Gana) of different gases collectively constitutes the Air element.
Similarly, different types of fluids (a group or Gana) collectively make the Water element. Water has one group, Air has one group, and in the same way the Earth element has a group of different metals and minerals within it, such as gold, silver, copper, stones, and soil etc.
The Space element too has its own group within it, like the inner space, and outer space, etc.
Lord Ganapati (another name for Lord Ganesha) is the lord of all these Ganas or groups. And since there are five principal groups, that is why this particular form is called the Panchamukhi Ganapati.
The main essence here is that God, who is Nirguna (one who transcends or is without attributes) and Nirakaar (the formless all-pervading Divinity) is worshipped by representing Him in this form by chanting sacred mantras.