It's a combination of pathfinding used in most games with tricks and tweaking to give the cars an advantage against you. The snow really helps them turn around quickly for example.