How does a chemical reaction produce a molecule that prefers one future outcome over another (life or death)
All chemical reactions have a "preferred" outcome. It is not an emotional preference or an intellectual preference. It's a myriad of tiny "decisions" like a river's "preferred" route. Rivers and chemicals generally "prefer" a particular direction because it's the easiest - i.e. it requires the least energy.
For example, H and O can combine in various ways but they generally "prefer" H-O-H rather than H-O-O-H. Chemistry is the study of those "preferred" outcomes.
Your mistake is in thinking that the chemistry of life is somehow "better" than the chemistry of non-life. The chemicals don't "choose" life over non-life. They just "choose" the easiest path.
“Maturity, one discovers, has everything to do with the acceptance of ‘not knowing.” -- Mark Z. Danielewski, House of Leaves