Why do departments hire GTAs instead of more permanent faculty? I notice departments often hire graduate students as teaching assistants.

I'm curious why departments do this instead of hire a lecturer to do the teaching. I'm sure this is helpful for the GTAs, since they're 1) getting paid and 2) getting teaching experience, but if the department is hiring GTAs to give the students teaching experience, then why not require students to teach as part of their programme? If one is concerned about "free labor" being exploitative, then one can also just add the extra money that would've gone to the GTA's salary to the student's stipend.

The only other reason I can think of is cost, and full-time lecturers are more expensive than part-time GTAs. Is this the case?

Edit: In the arrangement I'm familiar with, the students (which can be undergraduate, Masters level, or PhD) are funded separately. They could, e.g., be funded by a department scholarship or by their professor's grant. They are then offered TA positions in the department, which they are free to accept or decline. If they accept, they are paid a salary, effectively making them employees of the university.

This question applies to any country in which this is practiced.
Yes, full time lecturers cost more than graduate teaching assistants.  In addition, if they are hired with permanent contracts, then it is a long term financial commitment, which is more risky financially than a short term contract.