map() transforms data, flatMap() transforms into another Mono.
In a Mono, map() is used to transform the emitted item. In contrast, flatMap() is used when the transformation returns another Mono. For example, map() can change a User object into its name, while flatMap() can fetch related orders as a new Mono.