From BOU's wikipedia page:
"Both of Us" was released to critical acclaim, most praising Swift's feature, with some calling the country rap collaboration as a sweet and melodic catchy song.[2] The lyrics of "Both of Us" talks about racism and bullying. It was Swift who came up with the idea for the collaboration after she visited B.o.B's label Grand Hustle. The rapper explained, "She came to Atlanta and she hit up Grand Hustle. I wasn't there. Tip was there and I eventually linked with her in Dallas and the rest is history."
Didn't B.o.B suggest that they do a duet? and didn't he go to one of her shows to show her the track and she said yes and that she loved it?
Or she suggested then he showed her the track then she said yes?
