How do digital function generators generate precise frequencies?
That sort of generator uses DDS, or Direct Digital Synthesis
It keeps track of the phase of the required output in a register, and outputs the cosine of the phase.
To use nice round numbers, let's say you have a 10 MHz clock, and want to generate 1.000000 MHz. Each 100 ns clock cycle, your phase register gets incremented by 0.1 of a cycle. If you want to generate 1.000 000 001 MHz, then each clock you'd increment by 0.100 000 000 100 of a cycle.
Frequency resolution is cheap, you just give your phase register enough LSBs. In this case, mHz resolution with a 10 MHz clock, you'd need 10 digits if the sums were done in decimal, or as more likely at least 34 bits if they were done in binary. With binary arithmetic, sometimes the master clock will be a nice 'binary' frequency to get nice Hz resolution. With cheaper generators the designers often just throw another load of LSBs at the phase register, and have very fine resolution of a nasty binary Hz fraction, which is 'fine enough'. My low cost generator has μHz!
Only the top few MSBs, typically 10 to 16 depending on the quality (cost) of the output, get to drive the phase -&gt; cosine converter. As a result, the phase at your output is never more accurate than a few parts per thousand. However, the output phase error is non-cumulative, and over time, the waveform will keep the correct average rate of change of phase (aka frequency) with respect to the clock, and to any other channels being generated by the same clock.
So the frequencies are precise, the phases approximately so. It's this approximation to phase that means that DDS outputs have phase noise spurious outputs. These cannot be seen on an oscilloscope, but will be visible on any modest spectrum analyser.