The writing was on the wall for Hill after the signing of David Carr, so even getting a seventh-round pick for him was a win for the Niners. For the Lions, they can look at it as receiving a reliable backup for only a seventh-round pick next season.
This is about as close to a win-win trade as you'll ever see. The Niners were going to cut Hill anyway, but the Lions recognized that, with a shortage of quarterbacks, Hill could have gotten overpaid somewhere.
This way Detroit lands their guy without giving up a whole lot for him.
Hill is far from spectacular, but he's certainly a guy the Lions will feel comfortable putting in the game if something were to happen to Stafford. He's shown that he can win some games and will be able to help Stafford along in his progression.
Now Stafford knows someone has his back without being a real threat to his job, and the Lions have some much-needed insurance.