Start here. This is the direct spoken answer to practice first.
Overview
The key question is what shape each input element becomes after the transformation.
map transforms each input element into one output value, so a Stream<Order> can become a Stream<String> of order identifiers. If the mapping function returns another stream or collection-like value, map preserves that nesting. flatMap transforms each input into a stream and then flattens those streams into one stream. For example, orders mapped to their line-item streams become one Stream<LineItem>.