The CES function can be derived directly from the condition of constant elasticity of substitution. There are various ways to do this, but the simplest derivation occurs for a homothetic production function. Suppose we start with a homothetic production function $Q = f^*(K, L)$ and we rewrite this in intensive form as:
$$\begin{matrix} q = f(k) & & q \equiv Q/L & & k \equiv K/L. \end{matrix}$$
For this case the elasticity of substitution $s$ can be shown to be:
$$s = - \frac{f'(k)(f(k) - kf'(k))}{kf(k)f''(k)}.$$
Letting $r \equiv (s-1)/s$ and re-arranging this equation gives the second-order differential equation:
$$\frac{kf(k)f''(k)}{1-r} + f'(k)(f(k) - kf'(k)) = 0.$$
This equation has general solution $q = f(k) = c_0 (1 + c_1 k^r)^{1/r}$ where $c_0$ and $c_1$ are constants. Parameterising with $a \equiv c_1$ and $F \equiv c_0 \cdot c_1^{1/r}$ and substituting to obtain the extensive form gives:
$$\begin{equation} \begin{aligned}
Q = Lq = Lf(K/L) &= c_0 L \left( \left( 1 + c_1 \frac{K}{L} \right)^r \right)^{1/r} \\
&= c_0 \left(c_1 K^r + L^r \right)^{1/r} \\
&= F \left(a K^r + (1-a) L^r \right)^{1/r}.
\end{aligned} \end{equation}$$
The parameter $a$ can be interpreted as the capital intensity in production and the parameter $F$ can be interpreted as the overall efficiency of production.