With Albert Pujols departing the St. Louis Cardinals for the San Francisco Giants, the Cardinals needed to replenish the bats this season. So Carlos Beltran became a natural target. He was a free agent with a history of knocking the baseball out of the park, and he was represented by the same agent as Pujols, so the connections became obvious.
The Cardinals eventually agreed on a two-year deal worth $26 million, which is a pretty good deal given the hitting power that Beltran can still produce at 35 years old. Although it'll be impossible to replace Pujols's hitting power, Beltran can definitely come in and play at multiple positions and provide another additional bat to make the Cardinals potent.
The Giants on the other hand, are left scratching their heads. They've now essentially given up a pretty solid prospect in Zack Wheeler for a few months of Beltran, which resulted in no playoff berth. San Francisco is down to only Pablo Sandoval as a great hitter in their lineup, since no one really knows how well Buster Posey or Freddy Sanchez will recover from injury. It's puzzling San Francisco didn't even bother to pursue Beltran, and we'll see if they rue that decision in the months to come.