A legal teacher has a teacher's license (from the Thai Ministry of Education), a work permit (from the Thai Labor Department) and a one-year visa (from the Thai Immigration Dept)
The one year visa is issued on the strength of you having a work permit. If you don't get the work permit, you don't get the one year visa. They are inextricably linked.
An illegal teacher has no teacher's license and no work permit, and of course - no one year visa.
Illegal teachers are resigned to doing border hops and consulate runs to neighboring countries. Life is getting far more difficult in Thailand for this kind of teacher.