How does a stone "Know" that it should roll downhill?
The Universe does not "Know", it merely acts. Each tiny act is a stochastic step towards greater entropy. Those processes that maximise entropy gain by burning energy are favourable. The ones that do it fastest, bestest, win out.
How does life "know" how to evolve? It doesn't - it simply happens.
