Wether they went to LA with the Raiders or with the Rams didn't really matter to them. But the one scenario they didn't want was to be shut out of LA completely. Even though they are completely and utterly irrelevant in the market. Heck, the Rams aren't even that big. The most popular team in LA remains, well, the Raiders.
The Chargers had to pay lip service to the idea of staying in San Diego, and truthfully they could and should have gone in with SDSU on their new stadium being built in the parking lot of the now-demolished Jack Murphy Stadium. But the owner insisted on a downtown stadium like the Padres have, despite the fact that a) the team had played in the Mission Valley for decades and was established there and b) football stadiums of NFL size make no sense in downtown areas and are better placed in less-dense outer areas like Mission Valley in the first place. It's clear it was a poison-pill demand from an owner who clearly wanted to move anyway and had for some time.
Either way, we are far afield of San Jose.