The following morning Janaka again came before Viśvāmitra. He bowed low before the sage and touched his feet, asking in a pleasing voice, “Please instruct me what I should do for you today, O sinless one. You are worthy in every way of receiving my service.”
Hearing these words from the virtuous and gentle king, Viśvāmitra asked that they now be shown the bow. Janaka assented, but before taking them to see the bow he described its history.
Long past, in a former age the bow had belonged to Śiva. That deity had become angry with the other gods when they had denied him a share of the sacrificial offerings made by the sages. Śiva had threatened them with the bow saying, “I shall now sever your worshipable heads from your bodies. Stand ready on the battlefield if you have any valor.”
But the gods relented and quickly worshipped the infuriated Śiva. They had managed to appease him, whereupon he gave the bow to them. The famous bow was then given by the gods to Janaka’s ancestor, Devarata, after he had fought for them in a battle against the demons. It had since been kept in the king’s family, being worshipped as if it were Śiva himself.
Reference: Ramayana – Krishna Dharma Das