Karen R. answered 06/11/19
Experienced Tutor, Duke Senior, Specializing in Learning Needs
The languages that are today known as Spanish and Portuguese both began once as vulgar Latin.
There was no singular form of vulgar Latin -- this is just what linguists and historians call any informal version of Latin that was used on a day-to-day basis by "commoners." So, you could be in modern-day Rome and hear a kind of vulgar Latin which today has evolved into the dialect of Italian we hear there today. The same could be said for Madrid and Spanish or Lisbon and Portuguese or Paris and French.
So, Portuguese and Spanish never really "diverged," because that implies that they were once the same language.
Instead, they actually became two different versions of vulgar Latin when the Roman empire decided to teach only Latin to various groups of people with their own languages, sometimes even indigenous languages. The forms of vulgar Latin that came from this empire eventually developed into the languages we know today as "Romance languages" (languages with Latin roots): Spanish, Portuguese, French, Italian, and Romanian.
You can think of it like this:
Imagine that "Cockney" London English, Sydney Australian English, Cape Town South African English, and Brooklyn New York American English all decided they were different enough from formal, Royal English to say that they are entirely different languages altogether.
All these are versions of English, which we imagine have all independently become different enough from the formal, Royal English that these groups all not only have their own specific accents, but they have even now developed their own vocabulary and customs.
If we someday came to call these languages Londonese, Australian, South African, and Brooklynese, then the same thing just happened here as it did with Spanish, French, Portuguese, Italian, and Romanian.