The same way setting unreasonable deadline will only bring unusable results, which won’t help anyone interconnected to you.
It all comes down to proper management, there’s no magic way out of it.
Think about teaching your kids peogramming. Do you set deadlines on when they need to finish learning to read, when they'll touch their first computer, the date they need to have a working hello world ?
For any of these you'll probably be buying toys, books, discuss with your partner and arrange time etc. But none of those will be "deadlines", even if you intend to be very optimal in the progress
For instance infrastructure projects: a delivery date is set, but developpers blowing out that date is just a fact of life. What will you do anyway when your new dam or highway is 6 months late ?
Even at smaller scales, you'd schedule moving to a newly built house at a set date, but painfully know the developper can easily blow past that and you can't just take the date for granted, or you accept moving to an unfinished house.
Software projects are of course the same, at big and smaller scales. Just look at game delivery for the most piblic instances of setting "deadlines".
“We release when it's ready" is focusing on quality only, and deadlines are just fictional dates, and “we release whatever is ready in time” is the real world process, where the product is bargained to whatever can meet the deadline (in the airplane example, that would be redefining your destination as wherever the plane is at the designated landing time, and see you in court if you ever make it back to civilization)
I think few people understand that setting deadlines equals to choosing the second strategy though. A mix of both just puts it in the first camp (“deadlines are flexible”)