$\def\ed{\stackrel{\text{def}}{=}} $
As R.. GitHub STOP HELPING ICE notes in a comment, and athanos lee mentions in his answer, a linear combination of sine functions is another sinusoidal function only if the two functions have the same frequency. When the frequencies of the two sine functions differ, the resulting sine-like function varies periodically in amplitude between the difference between the amplitudes of the two summands and the sum of their amplitudes, with a frequency equal to the difference between their frequencies. This variation in amplitude is referred to as a "beat". The same device of rotating lines used in several of the other answers can be used to give a nice geometrical explanation of this more general case.
In the diagram below, the points $\ F\ $ and $\ G\ $ are revolving around the origin at fixed distances, $\ A\ $ and $\ B\ ,$ respectively, with $\ A\ge B\ ,$ and with fixed angular velocities, $\ \omega_1\ $ and $\ \omega_2\ $ radians per unit time, respectively. At $\ t=0\ ,$$\ F\ $ was located on the $\ x-$axis, at $\ (A,0) ,$ while $\ G\ $ was located at the point $\ (B\cos\varphi,B\sin\varphi)\ .$ At time $\ t\ ,$ the $\ y-$coordinates of $\ F\ $ and $\ G\ $ will therefore be $\ A\sin\big(\omega_1t\big)\ $ and $\ B\sin\big(\omega_2t+\varphi\big)\ ,$ respectively. If $\ \vec{OH}\ed$$\,\vec{OF}+\vec{OG}=\vec{OF}+\vec{FH}\ ,$ then the $\ y-$coordinate of $\ H\ $ will be the sum, $\ A\sin\big(\omega_1t\big)+B\sin\big(\omega_2t+\varphi\big)\ ,$ of those of $\ F\ $ and $\ G\ .$
On the other hand, $\ H\ $ revolves around $\ O\ $ with a variable angular velocity $\ \omega_1+\theta'(t)\ ,$ where $\ \theta(t)=\angle FOH^\color{red}{\dagger}\ ,$ and its distance, $\ L(t)\ $ say, from $\ O\ $ also varies. Therefore, its $\ y-$coordinate is also equal to $\ L(t)\sin\big(\omega_1t+\theta(t)\big)\ ,$ and this is not a sinusoidal function unless $\ \omega_1=\omega_2\ .$ Since $\ FH\ $ is parallel to $\ OG\ ,$ it follows that the angle between the extension of the line segment $\ OF\ $ and the line segment $\ FH\ $ is the same as $\ \angle GOH=$$\,\big(\omega_1-\omega_2\big)t-\varphi\ .$ Thus, if $\ \omega_1\ne\omega_2\ ,$ then the line segment $\ FG\ $ rotates around the (moving) point $\ F\ $ with a fixed angular velocity $\ \big|\omega_1-\omega_2\big|\ $ relative to the line segment $\ OF\ .$ The rotation will be clockwise if $\ \omega_1<\omega_2\ ,$ or anticlockwise if $\ \omega_1>\omega_2\ .$ It's clear, therefore, that $\ L(t)\ $ then oscillates with period $\ \frac{2\pi}{|\omega_1-\omega_2|}\ $ between a minimum of $\ A-B\ $ and a maximum of $\ A+B\ .$ Likewise, $\ \theta(t)\ $ oscillates with the same period between a minimum of $\ {-}\arcsin\left(\frac{B}{A}\right)\ $ and a maximum of $\ \arcsin\left(\frac{B}{A}\right)^\color{red}{\dagger\dagger}\ .$ The functions $\ L(t)\ $ and $\ \theta(t)\ $ are in fact given by
\begin{align}
L(t)&=\sqrt{A^2+B^2+2AB\cos\big(\big(\omega_1-\omega_2\big)t-\varphi\big)}\\
\theta(t)&=\sigma(t)\arccos\left(\frac{A^2+L(t)^2-B^2}{2AL(t)}\right)\\
&\hspace{-1em}=\sigma(t)\arccos\left(\frac{A+B\cos\big(\big(\omega_1-\omega_2\big)t-\varphi\big)}{\sqrt{A^2+B^2+2AB\cos\big(\big(\omega_1-\omega_2\big)t-\varphi\big)}}\right)\ ,
\end{align}
where
\begin{align}
\sigma(t)&\ed\cases{1&if $\ 0<\big(\omega_1-\omega_2\big)-\varphi\pmod{2\pi}<\pi$\\
0&if $\ \big(\omega_1-\omega_2\big)-\varphi\pmod{2\pi}\in\{0,\pi\} $\\
-1&if $\ \pi<\big(\omega_1-\omega_2\big)-\varphi\pmod{2\pi}$}\\
&=\text{sgn}\left(\sin\big(\big(\omega_1-\omega_2\big)t-\varphi\big)\right)\ .
\end{align}
The sign factor $\ \sigma(t)\ $ in the above expression is necessary because the arccos function is non-negative for all the values assumed by its argument, whereas $\ \theta(t)\ $ is negative whenever $\ \pi<\big(\big(\omega_1-\omega_2\big)-$$\,\varphi\big)\pmod{2\pi}\ .$
If $\ \omega_1=\omega_2\ ,$ then $\ L(t)\ $ and $\ \theta(t)\ $ are both constant , the length of the line $\ OH\ $ remains fixed, it rotates about $\ O\ $ with constant angular velocity, and the $\ y-$coordinate of $\ H\ $ is then a sinusoidal function of time, $\ L\sin\big(\omega_1t+\theta)\ ,$ the case treated in all the other answers.
Here's a Desmos animation to illustrate the case $\ \omega_1\ne\omega_2\ ,$ and
here's one to illustrate the case $\ \omega_1=\omega_2\ .$
There's one other special case that deserves mention. When $\ A=B\ $ the function $\ \theta(t)\ $ simplifies to $\ \frac{(\omega_2-\omega_1)t+\varphi}{2}\ ,$$\ L(t)\ $ simplifies to $\ 2A\cos\left(\frac{(\omega_2-\omega_1)t-\varphi}{2}\right)\ ,$ and the $\ y-$coordinate of $\ H\ $ becomes
$$
2A\cos\left(\frac{(\omega_2-\omega_1)t-\varphi}{2}\right)\sin\left(\frac{(\omega_2+\omega_1)t+\varphi}{2}\right)\ .\tag{1}\label{e1}
$$
This is almost invariably the only case treated in a typical introduction to the phenomenon of beats. As the Wikipedia article on beats says, the expression \eqref{e1} can be thought of as "a carrier wave of frequency $\ \frac{f_1+f_2}{2}\ $
whose amplitude is modulated by an envelope wave of frequency $\ \frac{f_1-f_2}{2}\ $" $\left(\text{where }\ f_i\ed\frac{\omega_i}{2\pi}\right).$ This is a little misleading, however, since it tends to leave one with the impression that the "carrier wave" in the general case will also be one with frequency $\ \frac{f_1+f_2}{2}\ ,$ whereas this is true only when the amplitudes of the two summands are exactly equal.
In the diagram below, the carrier waves $\ \sin\left(\frac{(\omega_2+\omega_1)t+\varphi}{2}\right)\ $ for the case $\ \frac{A}{B}=1\ $ and $\ \sin\big(\omega_1t+\theta(t)\big)\ $ for the case
$\ \frac{A}{B}=\frac{5}{3}\ $ are plotted on the same axes, with $\ \varphi=0, \omega_1=3\ $ and $\ \omega_2=3.3\ .$ Note that over two periods, $\ 2\times\left(\frac{2\pi}{\omega_2-\omega_1}\right)\approx41.9\ $ time units, of the envelope function, there are exactly $21$ peaks and troughs of the function
$\ \sin\left(\frac{(\omega_2+\omega_1)t}{2}\right)\ ,$ but only $20$ of the function $\ \sin\big(\omega_1t+\theta(t)\big)\ .$ Also, while there are exactly $10$ peaks and troughs of the function $\ \sin\big(\omega_1t+\theta(t)\big)\ $ over a single period of the envelope function, making it look very much like a sine wave with period $\ \frac{2\pi}{\omega_1}\ ,$ the sizes of the intervals between successive peaks and troughs are not the same, its true period is $\ \frac{2\pi}{\omega_2-\omega_1}\ ,$ and it is not in fact an exact sinusoidal function at all.
Here's a link to a Desmos animation to illustrate this special case.
$\,^\color{red}{\dagger}$ Bear in mind that the value of $\ \theta(t)\ $ depicted in the diagram is negative.
$\,^\color{red}{\dagger\dagger}$ These extrema occur when the lines $\ FH\ $ and $\ OH\ $ are perpendicular.