Marriages are treated as being valid unless/until it’s proven otherwise. that said, some cases are more problematic than others. there are also some cases where the priest stuffs up (for example by forgetting to obtain a dispensation) or there some other reason why things have gone haywire. In those cases if the couple’s consent and understanding of marriage is still ongoing and they still want to be married to each other then often the better (or perhaps less embarrassing / awkward) way to fix it is what’s called a radial sanation (basically a fix behind the scenes) rather than a convalidation. As Fr Z notes though, if the couple reasonably believed that their marriage was valid then their actions weren’t sinful. In any event, as he says, keep calm and call a canonist!
If the priest forgot to obtain a dispensation, then how would the couple ever know?
Some dispensations involve a request from the couple themselves supported by the priest/deacon who will be solemnising their marriage.
Other than this, it may be that the priest told them that they didn’t need a dispensation and they later found out that they did. Alternatively, they might even have been told that they didn’t need an annulment when in fact they did! All very awkward and embarrassing for the couple and for whoever gets tasked with cleaning up the mess!