Everything is being jostled around randomly. The molecules don't have brains or seeker warheads. They can't "decide" to home in on a target.
The only mechanisms for guidance are: diffusion due to concentration gradients, movement of charged molecules due to electric fields, and molecules actually grabbing other molecules.
It's all probabilities. This conformation makes it more likely that this thing will stick to this other thing. You may have heard that genes can be turned on or off. How? DNA is literally wound on molecular spools in your cell nuclei. When the DNA is loosely wound other molecules can bump into it and transcribe it -- the gene is ON. When the DNA is tightly spooled, other molecules can't get in there and the gene is OFF for transcription. There's no binary switch, just likelihoods.
Everything is probabilistic, but the probabilities have been tuned by evolution through natural selection to deliver a system that works well enough.