Homam is the worship made for a particular god by calling of Agni (Fire).
It is said that when Lord Brahma (the creator between Trinity) created man, he also made "Homam" to achieve the living of man and spiritual desires. The goal of all Homam is to enrich the environment and protect the people on a large scale. Sun is considered to be the main source of energy supply, and fire is considered to represent the energy of the sun. According to ancient texts on Homam, any offering to Agni in the form of God, in fact, is a proposal for the sun.
To worship any god, the offerings of Mantras by Havan reach directly to God through Agni Dev. In ancient times, havan (yajna) was used to get rid of any acute situation. To get relief in the battle of the King, to get rid of any fierce illness, to get rid of drought and flood were done. Even today, big politicians organize big havan for victory in elections and get success too.
You can also view the video -