Question says it all? Please ignore the divided part as I've found out the answer myself. But I've always wondered if there two Viceroyalties then you'd probably think that there'd be two countries that came out from them, I'd assume Mexico and Peru but now this happened.
Why were there two Viceroyalties? Was it something to do with the distance or the natives living there?
A reply to /u/robbie_patrick
You have multiple questions here that you should re-organize as they cover a very long period of time. Charles V (I of Spain) organized the two vice royalties due to considerations of distance and lines of communication. Letters can take 8 months to arrive from Castile to Peru. In this period the royals were very concerned with the issue of control of their colonies and agents, so trade and communication were arranged in hub and spoke fashion. For the Americas, that hub was Seville. So taking all the above into consideration, Charles set up two vice royalties.
Over time, the vice royalty of Peru was broken up according to the nature of exploration, settlements, trade, and resource extraction.
As to why they eventually broke up into multiple countries in the later centuries, this has been asked several times before, so feel free to use the search box.