Here's my theory--
I think Wario and Waluigi are human, and they were mistook for the Mario Brothers (during Yoshi's Island). However, Kamek realised that the fat one (Wario) was suprisingly strong, and the skinny one (Waluigi) wa vety smart, so he brought them up as their rivals. However, when Bowser found out, he treated the Wario Brothers like dirt behind Kamek's back, as he knew Kamek was far too powerful. However, when Bowser became an adult, he and Kamek duelled. Bowser won, and Kamek betrayed his master, returned to his old kingdom, and declared war as King Kamek. Wario and Waluigi were also kicked out. And, because of Bowser's mistreatment and Kamek's continuous hatred of the Mario brothers, they realised that the years of torture that they had gone through was because of the famous brothers.
Anyway, the war between the Koopa Kingdom and the Magipa Kingdom (as I like to call it) raged on, until Bowser kidnapped Kamek's only daughter, Kammy. Kamek fled, and without their leader, the Magipa army was destroyed. Kammy was tortured for her father's whereabouts, and when Kamek came back to the Koopa Kingdom to get Kammy back, she had come out an old woman, as old as Kamek himself. Bowser told Kamek the only way that he could change him back, is that Kamek rejoined his fold once more. Kamek reluctantly agreed, and the kingdom of Magipa was left in ruin.