Painfully, that's how.
I really struggle with titles. They always feel either too bland or too cryptic. I settled on the title for A River of Light while writing a scene in which the MC hallucinated, seeing a river made out of stars. It was a fairly important hallucination to the plot, so I figured it might work for a title.
It'll probably be changed by an editor anyway, so I'm not too attached to it, but I just can't slap a half-assed, boring title on my work. I think it sends a clear message of carelessness to editors and agents. It's like creating a very nice product and then trying to sell it in a Zip-Loc bag instead of nice packaging. I just can't do it.
So I agonize over titles a lot, even though they're subject to change by people who are much better at titling books than I.
Fortunately, Strange Songs, my next WIP, titled itself easily. It's about Houdini, and I was able to lift a portion of one of his quotes for the title. Thanks, Ehrich! You saved my ass.