This Yagya that you have described in your question is a Yogi’s Yagya. There is a Yagya for householders as well as the jyāni (the learned/ scholars). The form of Yagya changes depending on the spiritual aspirant. For a devotee, the definition of Yagya is different to a normal worldly person. However, overall the well-being of all relies on Yagya as God has said in Gita:
Sahayajñāh prajāḥ sṛṣṭvā purovāca prajāpatiḥ
Anena prasaviṣyadhvameṣa vo’stviṣṭakāmadhuk Gita 3.10.
Meaning: at the beginning, when the creator Prajāpati created living beings with sacrifice (Yagya)and said, “By this, shall you propagate; let this fulfil all your requirements for the sacrifice (Yagya)”.
This Yagya, mentioned in this verse, is to fulfil your desires. Will it fulfil all your desires?
Iṣṭakāmadhuk, meaning, it will fulfil those desires which lead to your well-being. A mother does not give her child everything it asks for. Not giving something that is not for the welfare of the child is a mother’s grace.
Prajapati Brahma created the world through this concept of Yagya. Thus Yagya should be interpreted in the correct context. This Yagya means, when you perform a sacrifice for the demi-gods, they will give you what you desire for whilst they gain energy through the Yagya. This way there is a symbiotic relationship of causing one another’s progress and thus well-being.
Devānbhāvayatānena te devā bhāvayantu vaḥ
Parasparaṁ bhāvayantaḥ śreyaḥ paramavāpsyatha Gita 3.11
Meaning: by this gratify the gods and let the gods foster you, these caring for each other selflessly through your duties, you shall attain to the supreme good.