Psychology has always been used as a tool for political manipulation. At its most crude, politicians historically used terror to control the public, and propaganda to mislead them. Certain contemporary methods, though, are far subtler.

Cambridge Analytica, the data analytics company behind Donald Trump’s 2016 presidential campaign, reportedly used some of the most sophisticated—and nefarious—psychological tactics to help secure political victory. Last week, the New York Times and the Observer (the British newspaper, published on Sundays and sister to The Guardian newspaper) reported that the company worked with a University of Cambridge psychologist to harvest the data of 50 million Facebook users without their permission.

Cambridge Analytica wanted this information not because it cares about who has the pithiest status update or what comment got the most likes, but because online activity accumulates into a huge amount of data. And these data, it turns out, can be used to reveal the nuances of personality types and voting tendencies. Such sophisticated voter profiles in turn give political operatives fairly detailed insight into type of messaging will be most effective to influence Facebook users’ opinions.

This method relies on “psychographics,” which is more or less an online application of decades-old principles of psychology.

Pollsters typically rely on demographic data to predict election outcomes. Demographic research tends to classify people according to clear-cut characteristics, such as age, sex, race, class, education, and employment. Private companies also study traits like the age and gender of who buys their products so as to sell more effectively.

Psychographics works the same way—except it uses personality type, rather than age and sex, to predict behavior. It’s not a brand-new concept; in the documentary Century of the Self, filmmaker Adam Curtis shows how researchers from the Stanford Research Institute (SRI) used psychology to understand both personality types and so predict political behavior of the US public during the 1980s. The SRI sent out a huge survey to build an understanding of personal motivations.

Questions included “I’d say I’m rebelling against the way I was brought up,” and “In general, it’s more important to understand my inner self than to be famous, powerful, or wealthy.” Members of the public weren’t used to being asked such probing questions and responded enthusiastically: SRI’s survey had a massive 86% response rate. “We were asking people to think about things that they’d never thought about before and they liked thinking about them,” Amina Marie Spengler, director of psychological values at the research program from 1978 to 1986, said in Century of the Self. “Like what they felt inside, what motivated them, what was their life about, what was important to them.”

Based on the results of this survey, SRI created a set of profiles that mapped onto psychologist Abraham Maslow’s theories of self-actualization. These defined people according to their lifestyle and values: “Inner directeds” considered personal satisfaction more important than status or money, for example, while “I-am-me’s” defied tradition to invent their own standards, and “experientials” constantly sought new and active experiences.

“We were trying to look into people’s underlying values so we could predict what is their lifestyle, what kind of house do they live in, what kind of car do they drive. The corporations were then able to sell things to them by understanding them,” said Spengler.

The same underlying values could be used to predict a person’s politics: “Inner directeds,” for example, consistently said they’d vote for Ronald Reagan for US president and Margaret Thatcher for UK prime minister. Psychology questionnaires effectively predicted voter behavior. “That was completely new,” Christine MacNulty, program manager at SRI’s values and lifestyles team from 1978 to 1981, said in Century of the Self.

Psychologists today no longer have to rely on questionnaires thanks to the huge trove of information they can glean from social media use. Psychologists at the University of Cambridge created myPersonality Facebook application, which asked Facebook users to take psychometric tests, including the Big Five personality test (which grades people on levels of neuroticism, agreeableness, conscientiousness, extraversion, and openness to experience), and stored the resulting data. Tens of thousands of people who took the test also gave permission for the academics access their Facebook posts and behavior. This has allowed academics to create models of what sort of social-media behavior correlates with particular personality types. Now, social-media use can be decoded to reveal levels of the big five personality types.

It doesn’t end there. Psychologists have used social-media behavior to measure depression, ADHD, race, physical health, political orientation, and sexual orientation, among other characteristics. Such findings tend to be accurate in aggregate, meaning it can effectively and accurately the level of depression, for example, within a given population, though the ability to predict characteristics based on social media use isn’t necessarily perfectly accurate on an individual level.

Cambridge Analytica reportedly went a step beyond current industry-standard practices, though, by harvesting social-media data without users’ permission. Though you might be less concerned about a third party accessing your Facebook posts than, say, your bank details, the implications are huge. Lyle Ungar, a University of Pennsylvania professor who researches the psychology of social media use, says he’s been approached by (and turned down) health-insurance companies who want him to help them trawl social media behavior to learn more about potential customers. Facebook posts may not seem like a window into your soul but, taken together, your social media activity likely reveals a huge amount about how you live: The hours you’re awake, how sociable you are, and, yes, even who you’re likely to vote for.