Spatial resolution describes the detail that can be seen in the image. The higher the resolution, the finer the details that can be seen in the image.
Increasing the frequency, improves spatial resolution. Higher frequencies have shorter wavelengths, and it is these shorter wavelengths that enable the system to detect more detail. Sonographers should always use the highest frequency they can to obtain the best spatial resolution.
However, there is a limiting factor: penetration.
High frequency sound does not penetrate through a medium as well as low frequency sound. High frequency sound is weakened (attenuated) more easily than low frequency sound.
If you live in an apartment building with noisy neighbors you will easily understand this. When the neighbor's music is loud, you tend to hear the bass, the low frequencies, rather than the higher frequencies because the walls have attenuated the higher frequencies.
So the sonographer must always make a compromise between resolution and penetration. To do this you should apply this rule of thumb:
"Always select the highest frequency that will penetrate to the region of interest"
Thus for a superficial exam such as a thyroid, you would select a very high frequency such as 15 MHz, while for a deeper examination such as a third trimester obstetrical scan you would need to select a lower frequency in order to have adequate penetration.