Activision used to own the rights exclusively. They lapsed and returned to Marvel. Marvel then agree to do an exclusive with Sony. Apparently Marvel approached Sony for a hero game, and Insomniac chose Spiderman. It's apparently in this podcast
https://kotaku.com/podcast-how-spider-man-ps4-came-together-1796328173
There wasn't any long-term deal signed; it was a one title deal. Subsequent deals will be made between Marvel and games companies,
If you don't understand the difference between lots of people renting a car and one person buying the car, I won't be able to explain it to you. Sony
rented the SM license to make
one game, and if MS want, they can presumably
rent the license too. If MS
buy the Batman license from WB, then Sony (or anyone else) won't be able to
rent it from WB, will they?