In 2018, filmmakers and TV writers had a lot on their minds. But one of the enduring preoccupations, for artists and audiences alike, was the need to discover and to cling to an identity.

Black Panther became the highest-grossing American film of 2018 because it's an unusually complex and stylish superhero picture, but also because it inverts the clichéd "cast of white heroes with one or two black supporting characters" paradigm. Black Panther quickly became more than just a movie to some fans. It was a long-overdue cultural happening. By the end of its opening weekend back in February, black athletes, actors, comedians, musicians, and fans were flashing "Wakanda Forever" signs, treating the film's success as their own triumph.

So it went throughout 2018. Television-watchers enjoyed the second season of Netflix's women's wrestling dramedy GLOW because it's so lively and engaging, but also because it's a show about strong, complicated ladies, made by strong, complicated ladies. The big-screen heist thriller Widows was acclaimed for its twisty plot, vivid characters, and sharp take on Chicago politics, but also because its leading roles are predominately women. Back on TV, FX's Pose employed a cast dominated by gay men and trans women — mostly black and Latinx — playing '80s New Yorkers expressing their desires in a repressive age.

Is latching on to a piece of pop art in part because of its identity politics a net positive for society? Read any major newspaper's op-ed page these days and some writer, from either end of the political spectrum, will be lamenting how Americans have been retreating into bubbles, using our media diets to self-segregate, away from anyone with a different background or point of view.

That's one way to look at it. Here's another: Maybe we're all just yearning for connection. The people on our screens this year were trying to escape the coldness and loneliness of the world by finding an accepting community. The audiences watching them were looking for something to aspire to. Many of this year's best movies and TV shows were about the near-universal experience of searching for a place to be comfortable and happy.

Sometimes these stories had a broader social context, as in Barry Jenkins' James Baldwin adaptation If Beale Street Could Talk, where a black couple in early '70s New York struggles to find a white landlord who will rent them an apartment, in a neighborhood where the police won't harass them. In a more roundabout way, Lee Chang-dong's low-boil Korean thriller Burning too is about the social barriers to fellowship, with Yoo Ah-in playing a poor country mouse who befriends — but can't ever really know — a shady super-rich city-dweller played by Steven Yeun.

These are two very different films, but both are partly about the different kinds of walls the ruling classes put up, to avoid sharing what they have. Burning is a murder-mystery, too; but its themes of exclusion and resentment make the mystery as existential as it is literal.

Similarly, director Debra Granik's Leave No Trace (based on Peter Rock's novel My Abandonment) is ostensibly a road-trip movie, following survivalist ex-soldier Will (Ben Foster) and his resourceful teenage daughter Tom (Thomasin McKenzie) as they elude the authorities, and look for a place in the wilderness to live in seclusion, off the grid. The tension and drama of this family's journey across the Pacific Northwest gains more meaning once it becomes clear that Tom needs the kind of stability and community that Will can't abide.

Tom's a little like Kayla, the awkward teen played by Elsie Fisher in Bo Burnham's Eighth Grade. These young women are both right on the cusp of adulthood; and even though Kayla's just suffering through junior high, not homelessness, she and Tom are both so deeply mired in their own bleak situations that they can't even imagine how better their lives will one day be, once they grow up a bit, and become independent enough to "find their tribe."

That's not to say tribalism doesn't have downsides. A few projects this year grappled honestly with the social conditions that drive people to bigotry and terrorism, including Spike Lee's thrilling '70s cop movie BlacKkKlansman, about a nervy real-life undercover operation to expose the dangers of the Colorado KKK, and the latest season of Supergirl, which has been using the heroine's Kryptonian origins as a way to tell a pointed story about ordinary citizens' fear of being usurped by "alien" "invaders." Both are smart enough to avoid reducing prejudice to some unknowable evil; instead they explore how a toxic stew of alienation, aggrievement, and peer pressure can give birth to violent reactionary movements.

Not every 2018 movie or TV show about feeling "in" or feeling "out" has had that hard-hitting of a message. Some are more offbeat and personal, like the wonderfully weird AMC series Lodge 49, where a pair of financially stressed Long Beach siblings see a chance to get their lives back on track when they discover a funky local social club, or the blockbuster animated Disney hit Ralph Breaks the Internet, where a video game character dreams of the chance to compete against the cooler, more challenging players she meets online.

In many ways we are a divided people. But what continues to unify us is that we all want to find somewhere to belong.