The story of the birth of Balram is found in the Srimad Bhagavad Purana and begins when Mother Earth (Bhumi Devi) takes the form of a cow and complains to Bhagavan Vishnu about the increase in the number of rulers and people following Adharma on earth. Bhagavan Vishnu to help Mother Earth decides to incarnate on earth. To achieve the goal of wiping out Adharma, Vishnu was born as Sri Krishna on earth. To help him Ananta or Shesha appeared as Balram.
Kamsa had imprisoned Vasudeva and Devaki after he learned that the eighth son of the couple will kill him. Fear made Kamsa kill all the babies born to Vasudeva and Devaki. Thus he had killed the first six babies.
When the seventh baby was growing in the womb of Devaki; Vishnu asked Goddess Mayadevi to transport the fetus to the womb of Rohini, another wife of Vasudeva.
Soon the news spread that Devaki had aborted. But the fetus was successfully growing in the womb of Rohini.
Rohini then gave birth to Balram, who is an incarnation of Ananta.
It must be noted that there are many Hindu communities who believe that Balram is a direct incarnation of Vishnu.