Both, color and clear sealers repel any liquids that are water-based and oil-based – basically, anything small enough to get into the pores of the tile and grout.
Grout that has a clear sealer will still let moisture in and out, but at a much slower pace compared to un-sealed grout, which buys enough time to clean up a mess. Color sealed grout does not let any liquids through.