I remember the Diablo I manual, as a wee child, detailing the backstory. Here are snippets from the manual:
THE DARK EXILE
“Seven is the number of the powers of Hell, and Seven is the number of the Great evils.”
Duriel, the Lord of Pain
Andariel, the Maiden of Anguish
Belial, the Lord of Lies
Azmodan, the Lord of Sin
As the Lesser Four continuously vied for the control of those forces that dwelled within their realms, the Greater Three held absolute power over the whole of Hell.
Mephisto, the Lord of Hatred
Baal, the Lord of Destruction
Diablo, the Lord of Terror
Taking snippets out of so this answer remains succinct:
The Three Brothers ruled over the Lesser Four by brutal force and malicious cunning. Being the eldest and strongest of the Evils, the Three Brothers were responsible for countless victories against the armies of the Light.
The Prime evils were the main three bad guys in the world, holding rule over Hell and assaulting the heavens.
With the ascension of Man and the subsequent standstill of the Great
Conflict, the Three Brothers began to devote their energies to the perversion
of mortal souls.
The Prime evils now become more sinister and work on corrupting man.
In their ignorance, the Lesser Evils began to believe that the Three were
afraid to continue the war with Heaven. Frustrated by the cessation of the war,
Azmodan and Belial saw the situation as their chance to overthrow the Prime
Evils and take control of Hell for themselves.
With this change of plan of the Prime Evils, led to them being overthrown.
The Prime Evils, weakened and bodiless, were banished to the mortal realm where
Azmodan hoped that they would remain trapped forever.
This is where the Horadrim come in to trap and bind the prime evils
Eventually, a secretive order of mortal magi was gathered together by the enigmatic Arch-Angel Tyrael. These sorcerers were to hunt the Three Evils and put an end to their vicious rampage.
They track down Baal and Mephisto:
Mephisto and Baal, trapped within the swirling, spiritual constraints of the
Soulstones, were then buried beneath the dunes of the desolate Eastern Sands.
And latter after much searching Diablo:
After a great battle which claimed the lives of many brave souls, the Lord of Terror was captured and imprisoned within the last of the Soulstones by a group of Horadrim monks led by the Initiate Jered Cain.
Some time passed and Tristram grew up around the monastery, with Diablo still captured beneath it in his soulstone, which is where the first game begins.