My understanding too is that these pills work alongside lifestyle changes. They make it a bit easier to make the lifestyle changes in part by helping control appetite. But if you don't implement the lifestyle changes while taking them, you'll just put the weight back on when you stop.
This comment is from a random guy on the internet familiar with some patient support programs that help people on these meds make those changes, so I would love corrected if I'm understanding this wrong.
Those commercials are about to stop interesting enough. They were only able to be on market due to the main drugs being in a shortage, which allows special pharmacies (compounders) to make knock off versions without going through the whole process the main drug did and bypassing patents.
The main drugs are now no longer in shortage, so in a few months, these compounders will not be allowed to sell those drugs.