When Bobby Bonilla gets name-checked these days, it’s probably in reference to one thing (and one thing only): His deferred contract. Bonilla hasn’t played for the New York Mets since 1999, but the team has paid him $7.16 million since 2011 and still owes him $22.67 million, to be paid in yearly increments of $1.19 million until 2035. The deal has come to define Bonilla’s career, which isn’t surprising considering that it represents an extreme intersection of our collective disdain for overpaid athletes and our fascination with contractual absurdities.

But before he and his contract became the living embodiment of #LOLMets, Bonilla was a very good ballplayer, overcoming long odds to earn that status. Even more surprisingly, he was worth just about every dollar he was paid until the Mets decided to defer his final payday with them.

Bonilla was undrafted after finishing high school in the Bronx, normally an inauspicious way to begin one’s pro baseball career. Still available after 853 players heard their names called for the 1981 MLB draft, Bonilla spent a semester at the New York Institute of Technology pursuing his interest in computers before Pirates scout Syd Thrift took a chance on signing him after seeing him play at a baseball camp in Europe. Bonilla would become one of the very few players to have any kind of a notable major league career from an undrafted start.

There were more hardships to come. Bonilla broke one of his legs during spring training in 1985, costing him most of that season and leading to his acquisition by the White Sox in the Rule 5 draft, an annual chance for teams to pick over prospects who haven’t been promoted to a team’s 40-man roster. Like undrafted free agents, Rule-Fivers don’t typically go on to have successful MLB careers, since a player who doesn’t sniff big-league action within four years of entering pro ball is usually a marginal talent at best.

But Bonilla was, once again, an exception to the cruel realities of baseball’s talent pyramid. After a decent start to his rookie year with the White Sox in 1986, he was traded at midseason back to the Pirates organization, which slotted Bonilla into its big-league starting lineup. After that, his MLB career was off and running.

From 1988 to 1991, Bonilla was the 17th-most-valuable position player in baseball according to FanGraphs’ wins above replacement metric, posting MLB’s 11th-best slugging percentage, 13th-best weighted runs created plus and its eighth-most batting runs above average during that time. With his combination of power, patience and batting average, Bonilla evoked memories of the game’s great line-drive hitters of old: players like Orlando Cepeda, Tony Perez, Willie McCovey and Willie Stargell.

So it came as no surprise that Bonilla had many free-agent suitors during the winter of 1991-92. Bonilla picked New York when the Mets offered to make him the highest-paid player in baseball with a five-year, $29 million deal. “I’m sure I’m going to get flak for the deal,” Mets general manager Al Harazin said after Bonilla applied pen to paper. Boy, was he ever right. Bonilla’s deferred contract isn’t the only deal that’s regarded as one of the worst in Mets history — his first one is, too.

But should it be?

Bonilla certainly had his share of run-ins with the fans and media during his first tour of duty in New York City. He infamously wore earplugs at the plate to drown out the boos that rained down on the 72-90 edition of the Mets that took the field in 1992 and then challenged sportswriter Bob Klapisch to a fight in the Bronx during an epic 1993 locker-room meltdown. (Klapisch had written a book about Bonilla’s first season with the Mets that was appropriately titled “The Worst Team Money Could Buy.”) His RBI totals were also down from his Pittsburgh days, when he posted the fourth-most RBIs in baseball from 1988 to 1991.

By now, though, educated fans know that RBIs are a hopelessly archaic way to measure a player’s production, influenced as they are by countless factors beyond a player’s control. Bonilla, for instance, went from a Pirates lineup in which he saw the NL’s second-most runners on base in front of him in 1991 (trailing only teammate Barry Bonds) to a Mets lineup that gave him 31 percent fewer base runners in 1992. In retrospect, it was no coincidence that Bonilla’s RBIs dropped by exactly 30 percent in the move from Pittsburgh to New York: He drove runners in at essentially the same rate — there were just fewer of them to drive in because the Mets had a significantly weaker batting order.

Bonilla’s on-base plus slugging (OPS) did slip a bit in his first season with the Mets (from 49 percent above league average to 21 percent above). But by the end of the four seasons that Bonilla spent with the Mets (he spent half of that fourth season in Baltimore after being traded), it was only slightly lower than it had been over his final four seasons in Pittsburgh. And although it might come as a shock to Mets fans of that era, Bonilla even earned his money — and then some — during his first stint in New York. According to Matt Swartz’s estimates of how much WAR was worth in past seasons, Bonilla was worth $30.2 million from 1992 to 1995, a full $6.3 million more than his tops-in-baseball salary paid him. The Mets may have had the worst team money could buy, but it wasn’t Bonilla’s fault.

After leaving New York, Bonilla continued to be a productive player, including during a stint in Florida where he produced 2.6 WAR for the Marlins as they won the 1997 World Series.

The following season was when Bonilla’s negatives started to outweigh his positives. He started 1998 reasonably strong, with a 117 OPS+ for the fire-sale Marlins, but tanked (81 OPS+) after a midseason trade to the Dodgers. Then came his second stint with the Mets — and this time, it couldn’t have been more of a disaster.

For the $5.9 million New York paid Bonilla in 1999, he produced 1.3 fewer wins than a replacement-level player would have. The numbers are horrific: a .160 batting average, an OPS 51 percent worse than league average and nearly as many strikeouts (16) as hits (19). Making matters worse, Bonilla was also a malcontent: He feuded with manager Bobby Valentine over a midseason benching and played cards in the clubhouse with Rickey Henderson as the Mets were being eliminated in Game 6 of the NLCS. Rather than keep Bonilla around for the final year of his contract, the Mets released him on Jan. 3, 2000.

And with that, the most infamous deferred contract in sports was born.

Over the last four years of Bonilla’s career — including two seasons with the Braves and Cardinals after he left New York — he produced -3.5 WAR and was paid nearly $13 million. (Not including the deferred payments the Mets have made since then.) He retired in 2001 at age 38 after not having been a productive player for four years.

And yet, over the course of his career, Bonilla’s WAR was worth a grand total of $51.5 million — an amount almost exactly equal to the $52.4 million he was paid. Bonilla, widely known as one of the most overpaid athletes in history, mostly earned his big-league paychecks.

There’s even a case to be made that the Mets’ deferral plan wasn’t a dumb strategy from the team’s perspective. For one thing, they used their Bonilla savings in 2000 to sign Mike Hampton, who had 4.6 WAR for the eventual National League champions. And when Hampton signed with the Colorado Rockies during the following offseason, the Mets used the resulting compensatory pick on David Wright in the 2001 draft, yielding the best position player in franchise history by far (according to WAR). Viewed this way, Bonilla has hardly pulled off the heist of the millennium.

All of this is not to say that Bonilla was a Hall of Fame-caliber player, or anything close. (He ranks 64th among all-time third basemen in the Jaffe WAR Score system, or JAWS, Baseball-Reference.com’s Hall of Fame metric of choice.) But he’s gotten a bad rap over the years for his falling-out with the Mets and the deferred contract. From humble beginnings in the game, Bonilla beat the odds to become one of its best players during his prime, even playing well after the Mets made him baseball’s highest-paid star. It’s amusing and absurd to think of Bonilla being paid $1.19 million every year by the Mets until he’s 72 years old, but that fact shouldn’t overshadow the rest of his career.