To begin with, Shantanu was the king of Hastinapura and Shantanu married the goddess Ganga(river Ganges).They had eight children altogether. Ganga Devi was forced to kill the first seven children (babies) in order to deliver them from the curse of Sage Vasishta. She would have dealt the same fate to her eighth child hadn’t Shantanu stopped her. By doing so,Shantanu had broken his promise of not questioning her any action, for the time she was his wife.[Read the detailed version]
After Ganga had left him, he married Satyavati with the promise of making her children the heir to the throne. This meant Bhishma (or Devaratta) had to take a lifelong vow of celebacy, hence the name ‘Bhishma’ (One who makes a terrible vow or promise).[Read the detailed version]
Satyavati bore two sons-Vichitravira & Chitranganda.These children born in Satyavati were very weak and inept at ruling the kingdom or for that matter-securing brides[Read the detailed version] .Therefore, all these fell into the able hands of Bhishma.Chitrangada was killed by a gandharva(a divine being) and hence Vichitravira became the king.
The wives of Vichitravira gave birth to two children Pandu & Dhritarashtra. Dhritarashtra, the older brother, was blind and Pandu was pale and sickly. Dhritarashtra had 101 children from his wedlock with Gandhari (who also remained blind with blindfolds covering her eyes, so that she could enjoy only those joys of life which her husband could).
As against the custom,Pandu,although being the younger of the two brothers, was made king since Dhritarashtra was blind.Pandu, for his part, could not have any children with his two wives Kunti Devi and Maadri due to a curse from his past. But Kunti Devi was blessed with an invocation which if invoked upon any god would cause her to have a child from that particular god. She taught the invocation to Maadri also.Therefore, Kunti had three sons– Yudhishtira (Yama), Bhima (Vayu), Arjuna (Indra). While Maadri had two sons-Nakula & Sahadeva (Ashwini Brothers).[The name of the gods on whom the invocation was used is given in brackets]
Hence,the five sons of King Pandu were collectively known as the Pandavas.
Kunti had, earlier, used the incantation unknowingly on Surya(Sun) and then Karna was born to her. Karna was thereafter abandoned by Kunti Devi for fear of shame since she was unmarried then.