It's a little more complicated than that -- the MLB and the A's want the team to move to San Jose, the Raiders want to tear down the O.co and build a football only stadium, and the city of Oakland wants the A's to consider building a separate baseball field in Oakland, which the A's don't really want to do. They did sign that lease, but it's a lot more complicated than "The A's are staying for 10 years," especially because the NFL unashamedly wants to move the Raiders to LA, and could use the A's continued presence at the O.co to do so.
The Niners just moved out for similar reasons (cash grab from the Silicon Valley), and everyone is watching the Warriors (scheduled to move out in 2017) very closely for the same reason.
TL,DR: Teams are going to move as close as possible to Silicon Valley in order to make tons of money.