Thank you for playing!
Technically the game generates 8 horses with random stats and then mathematically simulates 10 000 races to generate odds (Morning Line). In practice though, the simulation code is different from the actual race code, the race is not predetermined and I think like you said that the racing really comes down to chance unfortunately. I ran out of time to tweak things further.