Long enough to reset, not worry too much about health coverage, and if timed right.. not miss out on a bonus cycle. It's also short enough that you can interview and get a job offer from a company willing to wait for you. Often you can negotiate a signing bonus at the new shop to make up for compensation you may lose due to deferral or bonus cycle.
The firms trying to force 18 month terms are also some of the highest turnover shops. Arguably you'd need to demand a 50-75% bump to take the role since on the way out the door you are going to miss out on 1-2 bonus cycles. The term is so long you likely need to quit before finding a new job too, and then kick off interviewing in the last 6 months.
And often it's some percentage of your salary and doesn't include bonuses, RSUs, benefits, etc. It does make a company put some skin in the game and may even seem like a decent deal depending where you are in life but isn't a panacea. (E.g. MA put some much-delayed legislation in place a few years back over strong opposition but it's still something like a 50% of base pay requirement.)