by using low round draft picks to have the chance to get (quality) depth.
As far as I recall: a conditional seventh rounder for Martin, an early second round talent. Great.
A sixth rounder for a underachivieng former 10th overall pick. The benefits outweigh the negatives
Getting younger and a little cheaper in the backfield but keeping (almost) the same level of play. Nice move...
So the Niners didn't give away too many picks, still have an abundance of high picks, which you need to trade to move up, and adressed some depth needs.
PS: I wrote this from memory. So correct me please, if I am wrong.