By AJ Willingham, CNN

It only takes a few seconds to search for something on someone's Twitter account. With the right terms and a little bit of intuition, one may even find something that threatens to take down an entire career.

It's happened time and time again. Most recently, to Nick Vallelonga, a producer for "The Green Book," a feel-good story about interracial friends during the era of American segregation. He had to answer for an Islamophobic tweet from 2015 in which he supported President Donald Trump's false claim that Muslims in New York City cheered during the 9/11 attacks.

It happens to stars on the rise and stars at their peak. Late last year, actor Kevin Hart stepped down from hosting the Academy Awards, a gig he once described as a "dream," after tweets from 2009 to 2011 surfaced that contained homophobic language. In the world of sports, athletes at a critical juncture in their career -- an important game, a draft decision -- have been repeatedly waylaid by their own words that could have been dug up by anyone with a Twitter account and a vague inclination.

The question is, how does it keep happening at all? We live in an age of tweeting grandmas and child YouTube stars, of hyper-curated Instagram universes and infinitely expanding digital literacy. A reasonable level of social media awareness is not too much to expect -- for stars or the people that manage them. Why do famous people, whose images are central to their relevancy and livelihoods, keep letting themselves get played for their old bad internet behavior?

Why famous people tweet bad things

The question has some practical aspects and some philosophical ones.

Of course, the most practical -- and best -- solution would be to not throw problematic things into the public sphere at all. But, philosophically, things don't work that way.

"Every single one of us has bad thoughts," says Brian Harrington, a personal branding consultant in Los Angeles. He helps people build digital footprints that communicate an authentic image, and that can mean contending with controversy.

"As cool as someone like Kevin Hart is, there are going to be parts of him or anyone else that someone isn't going to like."

This disconnect between who someone wants to be to the public, and who someone is, was apparent last July when "Guardians of the Galaxy 3" director James Gunn was swiftly fired after old tweets surfaced that contained crude sexual jokes from 2010.

In his apology, Gunn said the version of himself he knowingly presented to the public was different then.

"Many people who have followed my career know when I started, I viewed myself as a provocateur, making movies and telling jokes that were outrageous and taboo," he said. "As I have discussed publicly many times, as I've developed as a person, so has my work and my humor."

Celebrities and other public figures may have an image they wish to present, but they also represent the projects they work on and the opportunities they court.

While authenticity may build fan bases, the host of a major awards show saying homophobic things or the producer of a race-themed movie expressing racially-charged language is, at the very least, a bad look.

"It used to be that the overarching brand had more power than the individual and that is no longer true," Harrington says. "The majority of these 'called-on-the-carpet' moments come from personalities that are trying to have a personal voice but are still at the mercy of the overarching brands, producers or channels for their income and popularity."

Why they get caught

It's also common wisdom that certain language is not going to play well with the general public. Whether or not someone is at risk of showing their proverbial backside can depend on how they view the role of social media, and how far back their public comments go.

"You have a generation coming up in social media who were there before they got famous or got into politics or sports," says Carol Brown Andrews, a partner at Grindstone Research in Nashville. Grindstone conducts opposition research for political candidates and interest groups. When people transition between the private and the public sphere, she says, all of that online behavior, conducted when no one was really watching, is suddenly under scrutiny.

Last July, Milwaukee Brewers pitcher Josh Hader saw his past come rushing back to him in real time during the MLB All-Star game. At a critical moment in the game, when Hader was pitching, old tweets from his high school years began to surface online. The tweets were full of racist and homophobic language, and the effect was immediate. Hader's family, who proudly attended the game in his jerseys, even put on other shirts to cover up his name on their backs.

After the game, Hader engaged in the typical apology one rolls out after being the subject of weaponized digital archaeology. He was sorry, he said. He was young. He was stupid. He had changed.

It's the kind of apology no one should have to make; chiefly because no one in the public eye should be tweeting offensive things. But if they do, it seems quite obvious they need someone to clean it up.

Allen Nesbitt of Nesbitt Research, an opposition research firm with offices across the nation, says he has a sit-down with every client where they start to dig into their history.

"We will sit down with the client, as well as their spouse, brothers and sisters, parents, that immediate sphere, and say, 'You are now a public figure. You will be exposed to a level of attention you haven't been exposed to before. We need to know what vulnerabilities we may encounter, and be aware, everything you post going forward will be scrutinized."

Nesbitt points out that not every social media landmine is an overtly racist, sexist or otherwise gross exclamation. A good researcher -- or manager or PR professional -- will even flag things that may have been okay to say at the time they were said, but carry a different weight or a different implication in the present.

If something happens anyway, and a bad social media post or piece of info comes back to bite someone, Nesbitt says it's crucial to get all the bad stuff out at the same time. And there usually is more bad stuff.

"It may start with one insensitive comment, but as you crack open that egg, you find that very seldomly does someone make one comment like that," he says. "You don't want to go out and apologize and do the redaction of one comment and pretend that it's done if there are actually years of comments that haven't been discovered yet."

Harrington notes that there is a fair bit of strategy present in a lot of these online takedowns. In 2016, NFL draft hopeful Laremy Tunsil saw his playing prospects -- and his money-making potential -- tumble when an old video of him smoking something in a gas mask surfaced at the same time as the NFL draft.

"Internet culture in general is a game," Harrington says. "There are writers trying to get clicks, there are people trying to go viral on Twitter. Maybe there is a financial or personal incentive. If you're the person that GETS Kevin Hart, that exposes the movie star. Attention is the currency of the internet and media, and people will take advantage of that."

Why the fallout varies

Back on the philosophical side of the equation, the entire concept of toxic tweets starts to warp and fray once you consider the tolerance a particular audience has for the behavior being called out.

This is especially true in the political sphere, where Andrews says she's seen candidates with repulsive social media behavior win in landslides, and other candidates lose because of social media mishaps that wouldn't raise an eyebrow in other situations.

"It depends on people who like them and people who back them," she says. "What may hurt you in one place, with one group, may not hurt you in another."

For instance, Nick Vallelonga, the producer for the "Green Book" who tweeted about 9/11, isn't just the producer of an awards show-ready film that has been criticized by some as an example of a "white savior complex." His father, Tony Lip, was actually the inspiration for the principal white character. This complex relationship compounds the impact of a tweet that, on the timeline of another public persona, may not draw a shrug.

Kevin Hart, on the other hand, may have "gotten away" with his tweets had he still been an edgy stand-up comedian with a filmography of supporting roles instead of an A-list movie star with a mainstream cred to uphold.

In fact, there are probably countless athletes bound for the majors; directors and actors waiting for their big breaks; politicians who have yet to run, who are at this very moment sitting on Twitter timelines full of self-planted landmines.

It just takes the slightest touch of fame to set them off.