I cannot understand the meaning of the soundness theory in first order logic. It says that if $S$ syntactically entails $p$, then $S$ semantically entails $p$.
However, $p$ don't have to be a sentence, which means that we should define the meaning of $S$ semantically entails $p$ where $FV(p)$ is not empty.
What is the definition?
There are two basic approaches in order to "give meaning" to open formulas.
According to the first one, the meaning (and the truth-value) of an open formula with respect to an interpretation $\mathfrak A$ is defined for specific "instances" of the formula.
In this case, we do not consider $p(x)$ but the corresponding instance obtained replacing the variable $x$ with a "name" or considering a variable assignment function $s$ that assign an object $a$ of the domain of $\mathfrak A$ to $x$.
In this case, the satisfaction relation holds for "instances":
See: Herbert Enderton, A Mathematical Introduction to Logic, Academic Press (2nd ed. 2001), page 83.
The relation of semantic consequence (or entailment) is defined accordingly [see page 88] :
The second case, limits the definition of meaning and truth value to sentences, i.e. "closed" formulas.
For open one, it adopts the convention that:
where $\text {Cl}(\varphi)$ is the universal closure of $\varphi$.
See: Dirk van Dalen, Logic and Structure, Springer (5th ed. 2013), page 67.
In this case :