Wa Alaikum Salaam.
The idea of 4 wives came about, as Mizfissy sadi, through the idea of war. If a comrades was killed then his companion could take his widowed wife as his own and provide for her ie give her shelter, food and basically a home.
Of course there are conditions for this. He must treat them both equally and cannot marry just for lust. He must also be able to provide for both his wives...