I do understand that for a signal to be properly sampled, it has to be done on the Nyquist sampling rate. What I do not understand is, what happens at sampling rates lower rate than the Nyquist rate, and at rates higher than the Nyquist rate, for that matter.
Short practical answer
for a signal to be properly sampled, it has to be done [at] the Nyquist sampling rate
Up front: sampling at the Nyquist frequency is the bare minimum rate to reproduce the frequency of the input signal. Dependent on your demands, I would advise to go at least 2 times that, if not more, to reproduce amplitude and shape of the signal. In other words, higher sampling rates yield better reconstructed signals.
The problem is that in this digital age, analogue signals are sampled digitally, i.e. at fixed sampling rates. The Nyquist criterion states that the sampling rate should be at least twice the target frequency of the signal.
Suppose the target signal is a simple sinusoid with a frequency f (Fig. 1). And let us start with the worst-case scenario, namely a digital sampling rate (SR) equaling f. In this scenario, we end up with a straight line in the digitally recorded signal (upper panel).
In case we slightly increase the SR to 4/3 the result is not much better (lower panel).
In fact, it is not until we we go to doubling the SR to 2 times f, that we obtain a saw-tooth with a frequency equaling the input signal. The shape is, however, unlike the input signal, but at least we have the target input frequency right. However, this does not mean we can faithfully reproduce the signal. For one thing, the amplitude of the input signal will depend on the phase shift between SR and the signal. From here on, you can imagine that going to 4 f will substantially improve the reconstructed signal in terms of shape and amplitude (see, e.g. this web page of Cardif Universiy).
Fig. 1. Discrete sampling of an analogue target signal. source: National Instruments
Here is the 10 KHz signal (the maximum frequency of the signal is 10 KHz):
Now, if we sample the signal at 5 KHz and 10 KHz, the signal will look like as shown below (the brown points):
It is clear that we can't get any useful information from the sampled signal. Now, to get some information about the signal, Nyquist said that we must sample the signal at least 2*max signal frequency. Now, here are the signals sampled at the Nyquist frequency and more than it:
It can be seen that by sampling at the Nyquist rate, we can get the frequency information about the signal. However, to faithfully reconstruct the signal, we have to increase the sampling rate even more.
For more details please visit https://www.gaussianwaves.com/tag/sampling-theorem/