The lesson starts with an online shop. A customer places an order. Now the system must send a confirmation email, update the stock count, tell the warehouse to pack, log the event for analytics and add loyalty points. The easy first version puts all five actions inside placeOrder().
Then marketing wants an abandoned cart campaign. Finance wants live revenue numbers. The fraud team wants to check purchases. Soon placeOrder() is 200 lines long and knows about every team in the company. It changes every week, because someone always needs one more reaction to "an order was placed".
The Observer pattern turns this around. placeOrder() just announces that an order was placed. Every interested service has signed up to hear that. Each one reacts on its own, and the order code does not change when a new one joins.
Observer is one of the 23 patterns in the 1994 Gang of Four book, in the behavioral group. Its intent is to define a one-to-many dependency between objects, so that when one object changes state, all its dependents are notified and updated automatically. People also call it the observer model, or publish and subscribe at small scale.