Short answer: glass-only replacement is meaningfully cheaper than a full window swap in almost every case, since you're not paying for a new frame, new hardware, or full reinstallation labor.
What drives glass-only pricing
Pane count (single vs double vs triple), size, and any special coatings like Low-E all affect price, but labor stays relatively low since the existing frame is reused.
What drives full replacement pricing
A full window includes new frame materials, hardware, installation labor, and often trim work — which is why it costs meaningfully more, and why it only makes sense when the frame itself has failed.