Kyrie Irving has many reasons to smile, choosing to play...

Kyrie Irving has many reasons to smile, choosing to play for the team he grew up rooting for in the Nets.  Credit: AP / Charles Krupa

How did this happen?

How did the Nets, a team that won just 20 games two years ago, land two of the biggest fish in free agency? How did they reinvent themselves as a glamour franchise? How did they convince Kevin Durant and Kyrie Irving that Atlantic and Flatbush in Brooklyn is a sexier destination than Midtown Manhattan?

They did it the hardest way possible, rebuilding from the ground up a team bereft of talent, high draft picks and even a kernel of hope. They found promising players where no one else could, developed them and treated them well. They established themselves as a smart young organization that isn’t afraid to think outside of the box.

And, as a result, they pulled off an upset of Alexandria Ocasio-Cortez proportions.

Having had 24 hours to let the shock of it all wear off, it appears that the real story of this year’s free agency isn’t so much the Knicks’ failure as it is the Nets’ triumph. The signing of Durant, a two-time NBA Finals MVP, and Irving, a six-time All-Star, would be an incredible coup for any team, even one not playing in the shadow of the Knicks.

It is made even more remarkable considering where the Nets came from.

It’s hard to overstate just what kind of state of disrepair the Nets were in when general manager Sean Marks and coach Kenny Atkinson took over a little more than three years ago. Thanks to a trade that is considered one of the worst in recent NBA history, the Nets had sent most of their draft picks through 2019 to the Boston Celtics. In exchange, they got two big-name-but-on-the-decline stars, Paul Pierce and Kevin Garnett.

When that all blew up — the Nets never got past the second round of the playoffs — the franchise was pretty much left with nothing.

Enter Marks, who had never been a general manager before but learned his craft under R.C. Buford of the Spurs.

Marks bought low on players who turned out to have high value, such as D’Angelo Russell, Joe Harris and Spencer Dinwiddie. He added Caris LeVert and Jarrett Allen from outside of the lottery.

Atkinson, who had never been an NBA head coach before, proved himself to be the type of straight shooter players can trust and like to play for.

And the team exceeded expectations by making it to the playoffs this season before losing to the 76ers in the first round.

Still, there was a modicum of luck in all of this. Irving grew up in West Orange, New Jersey, and while most people assume that would make him a Knicks fan — isn’t everyone in the tri-state area a Knicks fan? — he revealed Monday in a video on Instagram that he was a lifelong Nets fan. In the video, he said it has been his dream since fourth grade to play for the Nets. They were playing in New Jersey back then and went to the NBA Finals that year.

If the Knicks were a little less dysfunctional — if they had won more than 17 games this past season — they might have been in Irving’s and Durant’s plans. The bottom line is the two wanted to play together and Irving wanted to play at home. The Nets were the most attractive option.

Durant likely won’t play at all next season while rehabbing his Achilles, and there is no guarantee that he will be the same player when he returns. Yet it’s possible that he will vie with Julius Erving for the title of best player in Nets history when he returns. And Irving will be their best point guard since Jason Kidd.

The Nets, barring major injury, will be a force in the Eastern Conference for years to come. And it happened in three years.

Newsday LogoCovering LI news as it happensDigital AccessOnly 25¢for 5 months