As far as I can tell, these words are pretty much synonyms. "Wittern" seems to be more related to hunting, like smelling out prey, but I'm not sure.
If used verbatim, "wittern" refers more to detecting a smell over a distance. A similar English expression would be "to get wind of something", which also includes the idea of the wind or the air transporting the smell to the nose. "Riechen" is more general. If you for example take a bar of soap in your hand and smell at it, you'd "riechen" the fragrance, but not "wittern" it. Maybe, if the soap store has a lot of strong frangrances, you'd "wittern" them as soon as you open the door ;)
"Riechen" can either be used intransitively with the "sender" of the odor as the subject (Die Seife riecht gut "the soap smells nice") or transitively so that the origin of the odor is the object (Ich rieche die Seife "I smell the soap").
Figuratively, both verbs can be used to express that you detect something, for example
Er wittert die Chance, etwas Geld zu verdienen.
Das riecht nach einem Betrugsversuch.
Your impression is partly correct. The meaning of passively "riechen" and "wittern" have a lot of overlap, with "riechen" more in everyday use.
"riechen" can occur actively, that something smells, and passively through olfactory receptors.
"wittern" is indeed a bit hunting jargon, to smell the air if it carries a scent, or to have a premonition or anticipation that something is about to happen.
"Wittern" has a concrete meaning and a figurative one. The concrete meaning is overlapping with "Riechen" but the process of perceiving a smell is more active and more subtle/sensitive. And usually it's related to sense the smell of someone or something that poses a (potential) threat or that is a potential prey. The context is usually serious.
It's (usually) not used for catching the smell a nicely flowering scent or comparable.
"Wittern" is also kind of an active process. A hunting dog can start and try to "witter" before he actually has smelt anything.
In a figurative sense "Wittern" stands for the notion/intuition/inspiration that something is an indicator of something else, though it's at all not obvious.
And usually it's something of importance in a negative or positive way. You would not use "Wittern" for perceiving something trivial.
"Wittern" also has a meaning apart from "riechen". But it is taken out of the hunting context.
It can also mean something similar to "to have a feeling something is up/wrong". If I am remembering correctly it can also be translated to "smell" in this sense.
"Ich wittere Verrat" -> "I smell treason"
I woud say that normally you use “riechen” for humans while “wittern” is mostly used for animals like dogs.
"Hunde nehmen Witterung (eines Tieres) auf" "Das riecht aber streng sagt Hans"
But it depends a little on the usage/meaning. Like said by @henning-kockerbeck "eine Chance wittern" is a "human usage" for wittern. But right now I don't remember another "human usage" for wittern.