The most obvious difference between real essays and the things one has to write in school is that real essays are not exclusively about English literature.
How did essays become all about english literature? Colleges had always taught english composition. Eventually it became standard for college professors to do research along with teaching. So what what the teachers of english composition research? English literature. High schools then imitated universities.
The other big difference between a real essay and the things they make you write in school is that a real essay doesn't take a position and then defend it. Real essays are often exploratory (not that there isn’t a place for persuasive papers). You don’t start with a claim, you start with a question. In a real essay, you’re writing for yourself. You’re thinking out loud. But not quite. Just as inviting people over forces you to clean up your apartment, writing something that other people will read forces you to think well.
Questions aren't enough. An essay has to come up with answers. They don't always, of course. Sometimes you start with a promising question and get nowhere. But those you don't publish. Those are like experiments that get inconclusive results.
An essay is supposed to be a search for truth. It would be suspicious if it didn't meander.
How do you know if something is interesting? If it’s surprising, it’s usually pretty interesting.
What should the essay topic be about? It doesn’t really matter. It just has to be interesting, and mostly anything can be interesting if you get deeply enough into it.
How do you learn to observe interesting things? The more anomalies you've seen, the more easily you'll notice new ones. Also, ask why and don’t assume things are the way they are because they have to be. One more thing, study history (social and economic, not political).
If there's one piece of advice I would give about writing essays, it would be: don't do as you're told. Don't believe what you're supposed to. Don't write the essay readers expect; one learns nothing from what one expects. And don't write the way they taught you to in school.