HTL is an AEM template language that can be used to replace the use of JSP when developing an AEM component. HTL helps you to separate your design from your application logic. In this use case, the HTL logic is located within an HTML file and displays the result set. The Java part of the HTL component uses the QueryBuilder API.
To read this AEM community article, click https://helpx.adobe.com/experience-manager/using/htl_querybuilder.html.