Indra is the child of the son of the sky god Dyaus and the Earth goddess Prthivi. The most famous story about him is the slaying of the demon snake Vritra. The demon kept all the world's waters trapped causing an unending drought. Indra, powered by Soma a divine drink and armed with his Vajra, thunderbolt, broke through the demons 99 fortresses and eventually slew him. This deed earned him the right to be the king of heaven. The earliest recordings of this story have Indra be the supreme god over all others.
As Hinduism changed over time Indra's importance diminished. Virtually all stories about him now involve him losing his throne or being someway humiliated. Often his pride causes him to insult an important sage or a demon has been blessed by either or Brahma or Shiva with a defense Indra cannot defeat. He is only restored to his throne after being humbled or being saved by another god. His primary story of defeating Vritra has been retold where he has lost and needed Vishnu to arrange things to Indra could slay Vritra. Some versions have this be a crime where despite his evil nature, Vritra was still of the priest caste and killing him was a major sin. Indra had to seek out forgiveness for this and only after being purified could he take his throne in heaven.