It's better to think of the medication as more similar to other medications taken for chronic conditions (e.g. hypertension) than a quick fix magic pill.
The papers show consistent weight loss for ~52 weeks, then plateauing off onto 68 weeks. If you suddenly stop taking the medication, the weight creeps back on. The research therefore suggests you can likely slowly taper off the medication after year 1, but with medical supervision to ensure that doesn't lead to weight gain. This is also why improved mindset & habits are also important.
https://www.nejm.org/doi/full/10.1056/NEJMoa2032183
ELI5: increases satiety, decreases appetite.