Two totally separate events. Race season begins after the fair ends and goes much longer.
The fair is better and worse in its own way.
Better: rides, tons of food, garden show, hobby show, gem show, livestock, more family friendly etc
Not so good: crowds on the weekends, little shady spots, rigged games, etc
The races are great also! The excitement!
Better: gaming and betting on races, more adult crowd, dressing up, only busy closing/opening day, etc
Less great: gets dirty fast opening day, people drink too much, sad if you lose, limited free seating, etc