Disclaimer: This discussion is entirely based on mythology. So, the question of whether it really existed is immaterial. Also, as these are based on tales revised & passed through generations, I don’t find the point in talking about how true these events are. However, a healthy discussion is always encouraged.
“If the radiance of a thousand suns were to burst at once into the sky, that would be like the splendor of the mighty one. Now, I have become Death, the destroyer of worlds.”
— Bhagavad Gita
Brahmastra Definition :
Brahmastra was a weapon of mass destruction created by Lord Brahma, along with its more powerful versions like Brahmashirsha Astra, Brahmanda Astra, and Bhargavastra. Brahmastra could be compared to the modern-day hydrogen bomb. Let’s read through and find out how was this technology available back in the olden days.
Brahmastra is mentioned both in Ramayana and Mahabharata. First of all one should understand that the Brahmastra is not a weapon in itself, it is the “mantra” that post invoking it, it would give immense strength to (whatever the savior wants to use in order to save his subjects from the enemy) destroy the ferocious enemy, who otherwise can’t be controlled even with any other weapons available.
Brahmastra is said to have been used only once when Rama kills Ravana. However, Karna tried to use it on Arjuna but forgot the mantra due to the curse given by his Guru Parashuram.
There is also some books that say Ashwathama used Brahmastra against the Foetus Son of Abhimanyu, who was later called Pareekshit by Lord Krishna after saving him from it. But it was actually not the one according to the original Mahabharata written by Maharshi Vyasa. It was a different weapon.
brahmāstra: was released by Aśvatthāmā, Aśvatthāmā, the son of Droṇācārya, had thrown the brahmāstra to finish the last life in the Pāṇḍava family. at that time Kṛṣṇa entered the womb of Uttarā and saved the child Parikshit from the brahmāstra.
two brahmāstra weapons were released, one by Aśvatthāmā and by Arjuna, it created havoc and catastrophe. And the people were suffering. when Aśvatthāmā released his brahmāstra, there was big radiation, and people were feeling very terrible heat. And then Kṛṣṇa informed that “This heat is due to the Aśvatthāmā’s release of brahmāstra,” and Arjuna was advised, “Counteract it.”
it has the same symptoms of as nuclear weapons. The brahmāstra was a nuclear weapon controlled by mantra or sound vibration
The heat created by the flash of a brahmāstra resembles the fire exhibited in the sun globe at the heat produced by a brahmāstra. The atomic bomb explosion can at the utmost blow up one globe, but the heat produced by the brahmāstra can destroy the whole cosmic situation.
The brahmāstras are finer than nuclear weapons. Aśvatthāmā discharged the brahmāstra simply to kill parikshit, who was lying within the womb of Uttarā. Therefore the brahmāstra is more effective and finer because there is full control. The brahmāstra is not like that. It marks out the target and proceeds accordingly without harming the innocent.
There are numerous instances within Sanskrit scriptures where the Brahmastra is used or its use is threatened, including:
◾Vishvamitra used it against Vasishta, but the Brahmastra was swallowed by Brahmadanda, Lord Brahma’s countermeasure against the Brahmastra.
◾In the Ramayana a Brahmastra is used by Shri Rama several times: once against Jayanta (Indra’s son) when he hurt Sita, against Mareecha in their last encounter, against the Ocean when he did not answer his prayer to allow his army and himself to cross over to Lanka and finally in the last battle with Ravana. Also, Indrajit used Brahmastra against Hanuman, but Hanuman survived because of Lord Brahma’s boon, when he was destroying the Ashok Vatika after meeting Sita.
◾It is also mentioned in the Vedas that a Brahmastra was aimed by Shri Rama to carve a path out of the sea so that the army of apes could march towards Lanka, however at that moment, Varuna appeared and told Lord Rama about the technical flaws of using the weapon and hence it was later aimed towards Dhrumatulya by Lord Rama, which fell at the place of modern-day Rajasthan causing it to become a desert. Also, Indrajit aimed a Bhramastra at Lord Lakshman in the final battle between him and Lord Lakshman, however, the deadly weapon returned because Lakshman himself was the avatar of the Trinity.
- Capable of killing devas.
It is cited in the Mahabharata that Ashwatthama and Arjun used this weapon.
- It is thought that the Brahmashirsha Astra is the evolution of the Brahmastra, 4 times stronger than the Brahmastra. It is similar to modern-day hydrogen bombs or thermonuclear (fusion) bombs.
- In the epic Mahabharata, it is said that the weapon would manifest with the four heads of Lord Brahma as its tip.
In the Mahabharata era Parasurama, Bhishma, Drona, Karna, Ashwatthama, and Arjuna possessed the knowledge to invoke this weapon. This Astra can be invoked by using sacred mantras onto any object, even to a blade of grass (which Aswatthama did).
- In the Mahabharata epic, it is said that the weapon manifests with all the five heads of Lord Brahma as its tip.
- Brahma earlier lost his fifth head when he fought with Lord Shiva. This weapon, Brahmanda Astra is said to possess the power to destroy the entire solar system or Brahmand, the 14 realms according to Hindu cosmology.
- In the Mahabharata era Parasurama, Bhishma, Drona, and Karna possessed the knowledge to invoke this weapon.
- Later Parashurama, who had sworn to teach Brahmins only, laid a curse upon Karna because he lied about his real identity, that he would forget all the knowledge required to wield the divine weapon, Brahmanda Astra, at the moment of his greatest need when fighting with an equal.
- Upon Karna’s pleading, Parshurama gave him the celestial weapon called Bhargavastra, equivalent to Brahmastra but one that cannot be countered by any astra along with his personal bow called Vijaya, for being such a diligent student.
When this weapon is invoked, events similar to invoking Brahmastra and Brahmashirsha astra take place.
- As recorded in Hindu Puranas, when this weapon is invoked it will cause “the oceans to boil due to its heat and earth and mountains will float on the air and everything will burn without even leaving ashes”.
- When used for defensive purposes or as a counter to Brahmastra and Brahmashirsha astra it will swallow the above-said astras and neutralize it.
- When used for offensive purposes – nothing can stop or escape from it.
- Guru Drona possessed knowledge about this weapon and he never gave it to his son Ashwathama and his favorite student Arjuna.
During the Mahabharata war, Drona invoked this weapon to use it against the Pandavas army but due to the request of Gods and ancestors, Drona revoked this weapon because it would completely annihilate the Pandavas army who were fighting on the side of righteousness.
Brahmastra – 8 times.
Brahmashirsha Astra – 2 times.
In Ramayan, it is used at least 3 times.
- Meghanad uses against Hanuman and ties him with rope
- Rama kills Khara with it.
- Rama kills Ravan with it.
- Lakshman kills Atikaya with it.
Then, Rama snatched an arrow which is similar to the Ritual-fire, and secondary only to the ultimate missile, namely the Brahma-missile, for the elimination of Khara in war. [3-30-24]
In Mahabharat it was used twelve times by six characters:
- Drona and Yudhishthira used it on each other (two people).
- Drona and king Brihatkshatra did it on day 14.
- Drona and Dhrishtadyumna on day 15 (two people).
- Drona and Arjuna used it on each other.
- Arjuna used it twice on Karna (day 17). Karna used it on foot soldiers and then used it on Arjuna (day 17).
 Valmiki Ramayana – Aranya Kanda – Sarga 30
 Valmiki Ramayana – Yuddha Kanda – Sarga
Edit 1: I’ve written this answer, stitching excerpts from various online sources I could find at the time of writing. And I missed compiling them. As a result, I may not be able to provide them. Many people have been requesting sources. I’m sorry I couldn’t help you with that earlier. I’ll try to come up with the sources I referred if time permits.
However, as most of these are entirely based on interpretations, I would be grateful to those who can share whatever sources they come across – irrespective of their congruence with this answer. Thank you, people!