In a course about Galois theory, there is the following definition :
Let $L_1$ and $L_2$ be two subfields of the field $L$. We define the compositum $L_1L_2$ of $L_1$ and $L_2$ as the smallest subfield of $L$ containing $L_1$ and $L_2$, that is : $$ L_1L_2 = L_2[L_1] = L_1[L_2] $$
So does that mean that $L_1[L_2] = L_1(L_2)$ ? I can't see why.
In general, for a fields $K \subset L$, and $A \subset L$ the structures $K[A]$ and $K(A)$ are not the same, the former being the smallest ring, or also algebra if you prefer, containing $K$ and $A$ while the latter is the smallest field containing $K$ and $A$. These two can be different.
However, if $K \subset L$ is an extension of finite degree, more generally if it is algebraic, then in fact $K[A]=K(A)$. (As the inverse of $\alpha$ an algebraic element over $K$ is a polynomial expression in $\alpha$.)
Normally, in your context the extension will be algebraic, so there is no real problem. Still, at least in isolation that definition you recall seems a bit confusing.