What is the aerodynamic motivation behind vortex generators?
You are correct that vortex generators create drag, so a successful installation depends on reducing some other drag even more. Airflow separation causes significant drag that vortex generators can reduce. The energy consumed by vortex generators making drag is injected into the boundary layer, delaying airflow separation and the eventual stall, which might be of even more value. Correcting poor flight characteristics on an existing design is often where they are used. The illustration of a wing stalling is easy to understand but may not be the best use of VGs since few wings fly continuously on the brink of separation.