When you want to write the beginning of a novel, there are two helpful analogies to guide you through the process. The first analogy is that of
When you begin to wake up, you are within yourself and then slowly become aware, first of your physical sensations, then your surroundings, you begin to think of what you are going to do first (sit up, get dressed), and then plan the day ahead.
Waking up in the morning is like the familiar, everyday version of waking up in a different world. You come from your dreamworld and at first you will have to orient yourself and reaffirm who and where you are. This is an automatic process and quickly, but in essence it is the same as if you woke up in an unknown place and had to find out where you are and what is going on. You won't immediately graps the whole situation, but will look around, see what is there, interact with it, go a bit further, and bit by bit find out what world you are on.
Whenever a reader starts a new book, they are in fact entering a new world. The book may take place in present day America, but even then the reader (and even if they are native to that country) will have to orient themselves and learn who they are (the protagonist), where they are, and what is going on.
And, like with waking up, you'll not want to overwhelm the reader with too many things at once. You'll not douse them with a cold infodump, but allow them to gradually "wake up" to your world.
So the beginning of a novel is, first, a slow moving outwards from the protagonist or some other narrow focus to a wider view of the fictional world.
Now, that is the function – guide the reader into the story world – and structure – a gradual widening of focus – of the beginning, but the question was about the content of the beginning. To understand the content of the opening, a useful analogy is that of
I'm a psychologist and have spent the last decade or so writing academic journal articles. Empirical journal articles in psychology begin with an introduction in which you lay out the theory and present your hypotheses, continues with the methods you have used to test your hypotheses, the results of your study, and a discussion of these results and your methods in the context of the theory outlined in the introduction. Conventions for journal article structure differ between academic disciplines, but I have found the following principle to be almost ubiquitous.
In his guide on Writing the empirical journal article, psychologist Daryl J. Bem suggests a kind of funnel-structure for the introduction: from some broad, general observation about the world we live in ("Individual novels differ radically from one another in how they begin."), you become more specific ("Indeed the popular view is that you may begin your novel however you like."), and more ("But there is some evidence that the beginnings of novels all follow the same structuring principle."), until you finally propose the hypotheses you want to test in your study ("All novels begin with a statement of the theme of the novel.").
Now, a novel certainly isn't an academic journal article, but a novel is an experiment and its "introduction" has a very similar structure to that of an academic paper.
If you look at the waking-up analogy above, the novel begins with a narrow focus and broadens its view slowly, while the academic journal article begins broadly and then narrows its focus. And if we turn that narrowing funnel of the academic paper around and overlay it on the widening funnel of the novel, the hypothesis of the journal article comes to lie on the first sentence of the novel. And there is our analogy.
A novel begins with a hypothesis, and the rest of the novel is a thought experiment to test this hypothesis. That is why many opening lines of novels state a general principle or eternal truth – because they then set out to test the veracity of this principle or truth. And if a novel begins with "The day I turned sixteen I had no idea that in four months nearly everyone I cared about would be dead.", then the novels tests the implications of this.
Taking these two analogies together, we now understand that
a novel begins with a hypothesis and then slowly widens its focus to show the reader the world that this hypothesis is tested in.
You can, if you prefer, use other terms for the elements of the beginning. Instead of "hypothesis" you can say "theme" (which can be a moral principle or a character with specific traits in certain circumstances or something else), and instead of "widening of focus" you can think of moving from
- who the character is, in an intense moment, to
- what the character wants, to
- the character's place in the world,
as Brandon Sanderson does in the lecture that Amelia has mentioned in her answer.
Another alternative concept is the moral premise, as Stanley D. Williams uses the term in his book The Moral Premise. He suggests that every successful book or movie is based on "a statement of truth about the protagonist's physical and psychological predicament", or, in my words, a hypothesis about that predicament.