Rack bolts can occasionally shake loose on really bumpy roads. For this reason, it's important to grease the threads before mounting the rack and to occasionally check that the bolts aren't loose. A couple of spare rack bolts don't take up very much space and can be a handy part of any toolkit on a long tour.
These M5 stainless steel bolts are the ideal length for mounting most racks and fenders. They take a 4mm hex wrench. Price is per pair.