This flatness is required to both provide good results in the manufactured parts, as well as prevent the stick-slip phenomenon (jerking motion due to friction at low speeds).
Ways made from cast iron usually have to be scraped into the final dimensions by hand, which is a long and laborious process.
These materials are applied to the ways in strips with adhesive, acting as a sacrificial surface that wears instead of the iron, while keeping the same degree of flatness.
Flat ways are used when there is little requirement for the slide to be constrained perpendicular to the axis of movement, or the constraint is being provided by another component or otherwise not needed, such as on the carriage of a lathe.
Vee (V-shaped) ways provide constraint to the perpendicular horizontal axis, but do little to prevent the slide from being lifted vertically.