I have seen mentioning of panchagni several places; especially in Chhandogya Upanishad. There one sadhana is referred as "panchagni sadhna". Literal meaning of panchagni would be pancha + agni i.e. five fire. But what it is as per scripture? Is it five types of fire or some kind of offering used in any ritual?
The Panchagni Vidya is an Upasana described in Chhandogya Upanishad chapter 5.3. According to the Sri Vaishnava commentatory Ranga Ramanuja, the purpose of this Upasana is:
To introduce the "Panchagni Vidya" which is related to the meditation upon the true nature of the Jivatman freed from the contact of matter, and for causing detachment from samsara, as well as generating a desire for moksha, this episode is introduced.
Now what are the five fires? They are: svarga, parjanya, prithvi, purusha, and yoshit (heaven, rains, earth, man, and woman).
Each fire is followed by a metaphorical description of samit (fire stick for yajnas), dhuma (smoke), arci (flame), angAra (ember/char-coal), and visphulinga (sparks of fire). For example:
Heaven is the fire, sun is the fire stick, the rays are the smoke, the day is the flame, the moon is the ember, and the stars are the sparks. - 5.4.1
What is the relation? Ranga Ramanuja describes:
As the sun illumines heaven, so he is here described as the fire stick. The rays of the sun are the smoke, because smoke arises from the fire stick. The day is the flame because it illumines. The moon is the ember because the moon rises at the time of the setting of the day. The stars are obtained as parts of the moon and therefore, they are the fire sparks.
So just like this, the other fires have metaphorical descriptions of each of these five aspects.
Why are these fires described? The commentator says:
They describe the process of rebirth of the Jiva in this world after experiencing pleasures in the other world.
Basically, after experiencing pleasures in swarga (heaven), the soul falls down through parjanya (rain) to prithvi (earth), where he enters a purusha (man) in his sperm, and then into a yoshit (woman) through sexual intercourse.
And then the Upanishad describes the reward for meditating on this description (vidya):
Those who know the nature of these five fires in this manner, and those who practice in the forest meditating upon Brahman with faith, will ...[get moksha]. - 5.10.1
This is the basic idea.