An ante-post bet is placed before the race-day market opens, often weeks or months before the race. The attraction is the chance of a bigger price than the horse will be on the day. The cost is that the field is not known: a horse can be injured, rerouted to another race or kept out because of the ground.
Wikipedia notes that ante-post rules usually apply until the final declaration stage, about 48 hours before the race. Until then, a bet on a horse that does not run normally loses its stake. After the declarations, a withdrawn horse returns the stake, which is how an ordinary race-day bet works.