How does one assign probabilities to events? When studying probability I always had this doubt. Suppose we have one sample space $S$ then one event is a subset of $S$, that is, one element of $\mathcal{P}(S)$. The axioms for a probability function states that it is a function $P : \mathcal{P}(S) \to \mathbb{R}$ such that


*

*If $A\in \mathcal{P}(S)$ then $P(A) \geq 0$

*$P(S) = 1$

*If $\{A_i\}$ is a countable sequence of disjoint elements of $\mathcal{P}(A)$ then $P\left(\bigcup_{i} A_i\right) = \sum_{i} P(A_i)$


From that it is possible to deduce many things like $P(\emptyset) = 0$, a formula for probability of the union, and so on.
Now, nothing tells how does one define this function $P$. Indeed it could be anything provided it satisfies the axioms. Sometimes one can make an assumption that every $\{\omega\}\subset S$ has equal probability. In that case if $S$ is finite with $n$ elements we have
$$P(S) = P\left(\bigcup_{i=1}^n \{\omega_i\}\right) = \sum_{i=1}^n P(\{\omega_i\}) = np = 1$$
So that the probability $p$ of $\{\omega_i\} = 1/n$.
Apart from this situation (supposition of equal probabilities and finite $S$) I don't know how does one build a probability function $P$, that is, how does one define the probability of each event.
How is that done? Is this something done arbitrarily based on observation of a certain situation with the only constraint of obeying the axioms?
 A: You sort of answer your own question: "it could be anything provided it satisfies the axioms". In general, all one needs is to satisfy the criteria with a given function and it then gains the label of "probability function".
Now, if you are asking more about how we do modeling, then it might be instructive to study a few explicit derivations. A simple example would be to determine the probability of drawing a given color marble out of a bag:
There are $b$ blue marbles, $r$ red marbles, and $g$ green marbles in a bag. The probability one will draw a red marble is $r/(r+b+g)$. The probability one will draw a blue marble is $b/(r+b+g)$. The probability one will draw a green marble is $g/(r+b+g)$. In each case the probability to draw a given color marble is given as the amount of that color marble divided by the total number of marbles. The division by the total ensures that the probabilities of all events sum to 1 (i.e. to draw any color marble, the probability is 1/1). The procedure with the bag is important here, as we must randomly sample from the collection which means that each marble has a $1/(r+b+g)$ probability. Only after the fact do we notice the color. This is actually your intuition above: each marble is chosen with equal probability (as we use uniform randomness to make our choice) and then we group the events based on the color feature. So in the case of red marbles, each has a $1/(r+b+g)$ probability, but we have $r$ of them, implying the probability to choose any red is $r/(r+b+g)$.
Typically these types of idealized examples rely on some form of combinatorics to determine probabilities of events. However, idealization is a key feature here, as this example is deceptively simple. Idealized models assume we have perfect knowledge of the scenario/system. If one begins to look at examples in the real world, things begin to become less certain. Here we might consider a dice example:
Consider a 6 sided dice. Ideally, one would say that each side has an equal probability of occurring (i.e. each outcome has probability 1/6), but how do we know that the dice is not slightly off balanced or totally biased? We seem to be making a simplifying assumption based on how we believe dice to behave, when it may very well be the case that the dice is not the same as every other dice due to variations in it's physical structure. If we sit and toss the dice N times we might gather some data and assign probabilities based on that. The issue here is that there is no guarantee that we won't get all sixes or something else unintuitive during our data collect. One would need to roll the dice infinitely many times in order to produce the actual probability distribution. Even then it would seem that the dice's state would change due to impact with the surface we rolled in upon. Now we are technically dealing with a different dice (in a different physical state than the previous roll) each time we roll it. One might imagine a world where we could perfectly model the physics of the dice and then determine the various biases based on it's exact center of mass state at the time of each trail. In this case a very precise physical model would drive the assignment of probabilities to events. So we see here that you could construct a model and then derive event probabilities from that, and/or work from a collection of event sample data to assign probabilities to events.
One other thing you might find interesting are the various approaches to probability/statistics. Try asking Google about "Frequentists vs Baysians".
