Metallica started off like any other metal band in the '80s--kids who loved the new stuff but wanted to play it faster, harder, and louder. For Metallica, the metal they loved came from the NWOBHM era, or the New Wave of British Heavy Metal. In particular they cited Iron Maiden, Diamond Head, and Tygers of Pan Tang as major influences alongside other hard rock groups like Budgie and older heavy metal like Sabbath and Priest. Basically, a few Californian teens liked heavy metal and wanted to be the next new thing.
Metallica got a reputation as being wild and crazy in the early '80s by playing shows and being kids, notably in a very hedonistic style. They were as renowned for their music as they were for their lifestyles. Alongside Exodus, they would write the earliest notes of what most people call "thrash metal." Humorously, at the time Hetfield called their music "power metal" which eventually went on to be the name of another subgenre that instead focused on the lighter and more fantastical parts of metal.
Metallica had a solid reputation locally (in Southern California; they didn't move to the Bay until Hammett Burtonjoined) for a while and eventually they had enough exposure after playing shows and opening for more famous bands, which eventually led to them getting picked up by Metal Blade, but they would eventually record Kill 'Em All with Megaforce. The album was a big hit and it started to spread all over, inspiring metalheads to make their own bands.
At this point, Metallica are the flagship bearers of the heavier metal and thus they're well known in metal fanbases all over. They go on to release Ride the Lightning in 1984 and it's another smash hit. Lightning was famous enough to start making noise in the mainstream charts and thus Metallica was eventually picked up by a bigger label, Elektra. With Elektra they went on to release Master of Puppets.
This is the first point of exodus for many fans--a few hardcore guys had moved on to harder stuff by 1986 (death metal was picking up on the underground) and thus they didn't care much for Metallica. Master was too clean, soft, and polished and thus people weren't that interested. Nonetheless it was very popular among new fans and overall Metallica gained a bigger and wider fanbase.
Skipping forward to 1988, Metallica were the kings of heavy music in the mainstream--"One" was on MTV and they were a household name at this point. Still, they were firmly in the "heavy" camp and they were still somewhat of a niche, although popular. For their next release, Metallica forewent a metal approach and went for a much more hard rock style album with Bob Rock. The world received Metallica, also known as "The Black Album," in 1991. This was a polarizing album but honestly, it has gained that reputation moreso as time has gone on. While there were plenty of people who were appalled at the lack of aggression featured, plenty of fans also saw it as a new sound that was more conscious to what was hitting the charts at the same time. Nevermind was released in the same year--heavy metal was out and alternative was in. Metallica somehow avoided the death of heavy metal with a much more populist and less fantastical self-titled album. Like the albums before, they managed to pick a new fanbase as well which propelled them to the top of the charts. Metallica was hitting its peak at this point. While they did have their naysayers, plenty of people still enjoyed them. To underground metal fans, however, Metallica was starting to become to butt of every joke. You can't be on MTV that much and not expect a backlash from your original underground fans.
So Metallica took five years to release their next album. This was a pretty long time and a lot had changed musically--grunge had already died and nu metal was starting to be prominent. Still, Metallica was still grandfathered in as a heavy metal legacy. They were a real mainstream band by this point--they were no longer subject to trends, they had defied that. Thus people heavily anticipated their album.
Then when the initial promos came out, there was actually a very stark outcry to one thing: Metallica had cut their hair. Long hair was emblematic and ubiquitous of heavy metal in the '80s--metalheads were longhairs, end of discussion. This stark cut actually caused a certain amount of uproar at the time. When Load was released, they had taken yet another further step away from thrash and extreme metal--what came out was more hard rock than ever. Needless to say this extremely eliminated fans, especially what were left of the fans who had been introduced to them in the Master era. But the hype was undeniable--Metallica were a legacy now, and everyone knew about them. Load hit number one on the Billboard and sold a ton of albums. Basically at this point it didn't matter what Metallica did, they were rockstars and whatever they did would sell and people would buy it, despite having a large number of people who didn't like they were putting out. Metallica were very popular but they had done so by systematically eliminating groups of fans along the way. It seemed they could do no wrong in the music industry.
That was, of course, until the Napster debacle. Metallica (and Lars Ulrich in particular) came amount strongly against the website noting that it had hurt their profits. It may seem as though by this point they were clearly in it for the money, but rock 'n' roll still had the reputation of being anti-profit and more authentic than people seeking profit. Their statement put them in direct contrast of that mentality. The Napster debacle basically showed Metallica for what they were--guys more concerned with making money than music. Of course, people had been saying this for years in different circles but now the evidence was plain to see for everyone.
Metallica is seen as the epitome of a sellout band now. From their humble underground beginnings in Socal basements to super stardom, somewhere along the way they sacrificed their integrity. Exactly where they did that is up to the listener.
What is universally interesting is that in the metal circles nobody wants to talk about Metallica anymore because they're tired of doing it. For some of them they've been reiterating the same points for thirty years and they want to talk about something else. Metallica talk is almost taboo in the fact that by the time you start participating in the metal scene it's almost an unsaid understanding that you know exactly where you stand on Metallica and you have no need to bring them or discuss their albums anymore. It's kind of cool how ubiquitous they are but at the same time it goes to show the insane exposure Metallica has had with their work. It's impossible to escape them, so in the more dedicated metal scene it's best to ignore them.
TL;DR: Metallica got their popularity (and maintained it) by gaining more fans than they would lose with every release. Eventually their strategy revealed itself to be more money-oriented than music-oriented and a lot of people saw through that illusion which led to backlash. That's not to say it didn't work, because Metallica is one of the most well-known and bestselling bands on the planet.