The hopeless polarization of American society is both a truism and a taboo. We may be divided by class, race, ideology and any number of other forces, but many of us also cling to the belief — or the delusion — that a larger consensus still holds us together. Failing that, we can at least still be nice to one another when the occasion requires. Can’t we?

“Beatriz at Dinner,” a new film directed by Miguel Arteta and written by Mike White, unflinchingly addresses that question, and declines to provide a comforting answer. The setting is a dinner party at a Southern California mansion made awkward by the presence of the title character, a massage therapist played with regal composure and understated mischief by Salma Hayek. The differences of background and economic status between Beatriz and her hosts are obvious enough, and the film hardly ignores them. But this is neither a simple satire of privilege nor a mock-provocative comedy of diversity and its discontents. It’s about a clash of values, about unresolvable contradictions. Or to put it another way, about good and evil.

Beatriz, who lives with dogs and goats and who works mainly with cancer patients at an alternative-healing center, is undoubtedly good. But because she is a Mike White heroine, she is also complicated, sometimes abrasive and not always pleasant to be around. She demonstrates obvious kinship with the characters played by Molly Shannon in “Year of the Dog” (which Mr. White wrote and directed) and Laura Dern in the HBO series “Enlightened” (which he created). Her righteousness doesn’t make her saintly. It makes her interesting.