POS systems mostly can detect thermal printers automatically, as far as I know there are only two ways for an installed application on ios to do that, either by faking it as an Airprint or going with IPP protocol. Since it mostly matters for those application that your printer should be on the same network and subnet configuration and Airprint doesn't support thermal printers, I believe that could be choice that they are using. But my question is that if there is another way that they are all doing it? if not how an application on ipad(iOS) can detect those printers without any need for specific driver installation? If anyone can help me with this would be great!
To print to printers from iOS you can either use the AirPrint API with AirPrint enabled printers or you can implement the printer's protocol and PDL within your own application.
Some solutions include a third middleware like component to fill the gap between the mobile app and the actual device. This is not an elegant way but seems to work for some usecases.
The full process consists indeed of two steps: discovery (like setup) and actual printing (like sending a document). With AirPrint you can check the documentation to learn how Bonjour aka ZeroConf works.