The year was 2001, and Target did something that would be unthinkable today: it outsourced its entire online operation to Amazon.

It seems crazy, but Target wasn't alone. Big names like Borders, Circuit City, and Toys R Us all did the same thing.

Now those other brands are basically gone, but Target is thriving. So what did Target do differently? Why did it survive when the others didn't?

Here's the story about a bold move Target made, that looks totally brilliant in retrospect.

Borders, Circuit City, and Toys R Us

Let's go back to the start. E-commerce was still new in 2001. Online sales amounted to barely 1 percent of all retail. And Amazon was a small fraction of its size today. It had never turned a profit.

Meanwhile, big retail leaders wanted to focus on their core businesses, so a parade of brands went into partnerships with Amazon. Here's part of the timeline:

August 2000 : Toys R Us announces a a 10-year exclusive partnership with Amazon.

: Toys R Us announces a a 10-year exclusive partnership with Amazon. April 2001 : Borders, then the second-largest U.S. bookstore chain, strikes a deal to let Amazon take over its entire digital operation.

: Borders, then the second-largest U.S. bookstore chain, strikes a deal to let Amazon take over its entire digital operation. August 2001: Circuit City, the number-2 consumer electronics chain, does a deal with Amazon.

But, look at where they all wound up:

Toys R Us needed a lawsuit to get out of its Amazon deal. Afterward, it never put anywhere near enough resources into its own online sales, and the company closed its doors in 2018.

Borders got out in 2007, but lasted only four more years before going bankrupt and closing all its stores.

Amazon grew its electronics business to $1 billion a year by 2004. Five years after that, Circuit City was on its own, in bankruptcy and closing its stores.

Target basically went into the same kind of deal -- right after Circuit City, in fact. It was announced in the early morning of September 11, 2001.

But the big difference that came later was that Target perceived the threat that a quick-growing Amazon posed, negotiated its way out, and poured tons of money into building its own digital operation.

The Target deal

It's worth noting how Amazon and Target switched places during the course of their deal.

At the start, Target was much bigger, based on market capitalization: $31 billion for Target versus $4 billion on the day they signed the deal. But then...

In July 2006, when they agreed to extend the deal through 2010, Amazon had grown to about $15 billion, while Target was worth just over $40 billion.

By August 2009, Amazon had grown to roughly $40 billion, while Target had fallen to just under $34 billion. (This is when they announced the end of their deal.)

By Labor Day 2011, when Target launched its own site, Amazon was at $85 billion; Target was still just over $33 billion.

Today, while Target has grown healthily ($56.16 billion), Amazon is off the charts at over $900 billion.

In short, Target saw what was going on. And the fact that it had tied its online efforts to Amazon wasn't helping its competitive position.

In the words of former Target executive Casey Carl, who later became Target's chief strategy and innovation officer (but who left in 2017): "They learned a ton on our dime, and we didn't learn much [in return] and that's a massive issue."

Growing pains

In 2009, Target made its bold decision. It announced it was going its own way, and it went live on its own digital destination in 2011. It also poured literally billions of dollars into its technological infrastructure.

Compare that to Toys R Us, which in 2017 said it would put a relatively paltry $100 million over three years into its online product. It just wasn't enough.

Granted, the first version of Target's site had issues. Carl was later quoted as calling it a "horrific, ... monolithic stack of code ... [and] a frankenmonster of a website" that crashed at the most inopportune times. .

"Amazon is extraordinarily good at technology and logistics, so when Target decided to do this on its own," said Lee Schafer, a columnist for Target's hometown newspaper, the Minneapolis Star-Tribune who has written extensively about the company, "it was a huge tech problem and [took] years and a lot of money to catch up. ... I think they deserve a lot of credit for getting back here."

A unique experience

It seems like we're well past that now. At Target today, the focus is on creating a unique Target experience across online shopping, the Target app, and in-store.There's no longer that sharp divide between online and "the real world."

Among the features they've rolled out:

Target+ ("Target Plus"), which is "a curated assortment of products from third-party sellers on Target.com."

Wallet, within the Target app, that lets customers check out with their phones.

"See It in Your Space," which uses augmented reality to show customers what potential purchases would look like in their home.

Fulfillment options like order pick up and Drive Up, which is Target's curbside pickup service, along with Shipt same-day delivery, and 2-day shipping options.

Now, sales are up, its most recently earnings report beat every Wall Street forecast, and parts of its digital effort -- like in-store pick up and same-day shipping -- are getting a lot of credit.

But it's easy to imagine a world in which Target didn't move quite as quickly, and stayed tied to Amazon until it was too late.