What happens in that situation?
Available assets and income that aren't exempt from creditors (O.J. Simpson's trophies come to mind) are collected and the rest isn't collected and accumulate's post-judgment interest.
Sometimes judgment creditors will try to continue to collect a debt from meager future income after all non-exempt from creditors assets have been seized, even if the dollar amount collected returns almost nothing net of legal fees for collection to regularly remind the judgment debtor of the harm done.
Sometimes the debtor goes bankrupt (or is involuntarily forced into bankruptcy by creditors) and sometimes the debt is discharged in bankruptcy (often a procedural screw up by a judgment creditor can cause an otherwise non-dischargeable debt to be discharged in bankruptcy).
Sometimes the debtor goes bankrupt and only other debts are discharged in bankruptcy (making it easier for the judgment debt that survived bankruptcy to be collected since it isn't competing with other creditors).
Sometimes the debtor doesn't bother to go bankrupt and lets creditors try to involuntarily collect the debt from meager assets and income that aren't exempt from creditor's claims.
in a case where the jury has assessed that the damages caused by the
defendant are worth millions of dollars, but they clearly have no way
to pay it, what is the purpose of specifying an amount that big?
Not having money now doesn't imply not having money later. Maybe someone will inherit money, win the lottery, write a book and get royalties, etc. This matters especially because some debts can't be discharged in bankruptcy (including this one arising from a criminally caused injury in most cases) if the proper steps are taking in a bankruptcy case to prevent this from happening.
It may provide a means for quantifying damages in a lawsuit against a third-party such as a co-conspirator or an institution responsible for the tortfeasor's conduct, when trying to collect from them, or in an effort to make an insurance claim to the extent that property damage or personal injuries were involved.
In a bankruptcy, the assets that do exist and are available for creditors of the same priority are paid in proportion to the dollar amount of each claim. A larger award means a larger percentage of the assets available in a bankruptcy estate. (The same analysis applies to distributions to assets to creditors out of a probate estate is the judgment debtor dies with some of the judgment not yet paid and the judgment debtor has some assets left. Often assets exempt from creditors in the hands of a debtor are not exempt from creditors once the asset is owned by a probate estate like a personal residence that the decedent no longer resides in.) For example, suppose that the debtor haas $100,000 of assets and has $100,000 of other debts of the same priority in bankruptcy/probate. If this judgment is $100,000, the judgment creditor gets 50% of the available $100,000 (i.e. $50,000). If the judgment is $900,000, the judgment creditor gets 90% of the available $100,000 (i.e. $90,000). If the judgment is $9,900,000, the judgment creditor gets 99% of the available $100,000 (i.e. $99,000).
The judgment provides settlement leverage to voluntarily get more assets from the judgment debtor than would have been possible to collect otherwise (e.g. out of exempt assets or by causing the debtor to work when otherwise the debtor would have considered it futile to do so).
There are good policy reasons for not letting a jury know about the ability of a defendant to pay when determining an amount owed. Sometimes that will result in a verdict much larger than the ability to pay, but preventing the trial from being complicated by, and the jury from being influenced by, someone's ability to pay is a desirable goal. If a plaintiff wants to pursue a debt that the plaintiff can't collect, that is up to the plaintiff who may have non-economic reasons for doing so. Particularly in a civil case based upon a criminal case where there was a guilty plea which limited the presentation of evidence related to the case, the plaintiff's primary goal may be to tell society what really happened and to have a jury condemn that, and the ultimate money judgment may be basically an afterthought, even if it is huge.
It provides symbolic justice, even if it can't be enforced. This shows very strong condemnation of conduct by society that may serve as a warning to more affluent people considering engaging in the same conduct who can pay. For example, a $100,000,000 award in a civil case against a child rapist may be uncollectible against someone with a net worth of $2,000, but may send a strong message to someone with a $1,000,000,000 net worth considering doing the same thing, or to an institution with major assets considering letting conduct like that go unreported.