Flat washers are used mainly to ensure the nut presses against a full 360° smooth surface, or to stop the surface being damaged by the nut or bolt as they compress. But washer as stated by others here can also be used for many other reasons, ranging from space fillers when a bolt is too long or an internal space needs packing , to increased surface area for pressure distribution, crush washers for a seal, some act as a lubricant against another surface eg nylon washers, some act to reduce friction and let a nut and bolt spin, some act as a friction plates to increase friction eg in a Foxbat throttle, to stop the throttle sliding open, but allow it to move when pushed.
They basically give engineers a lot of options in how to attach items with different characteristics.