Back in 2015, the San Francisco Giants were in a close competition with the Los Angeles Dodgers for the NL West title. However, their starting rotation was weak, and they needed another arm to bolster the staff.
They found that arm in Mike Leake.
At 2015 staff was fronted by Madison Bumgarner, with Jake Peavy, Tim Hudson, Matt Cain, Tim Lincecum, Chris Heston, and Ryan Vogelsong all seeing time in the rotation at various points in the year.
Between injuries and underperformance, Bumgarner and Heston were the only reliable options throughout the season, so trading for Leake made a good deal of sense in pursuit of a playoff berth.