Most states don't require home inspectors to be licensed. Although licensing doesn't guarantee competence, it's a basic credential that should be available for consumers as a baseline to judge an inspector's background. First of all, you should choose the inspector yourself, rather than let the real estate agent recommend one. Although agents are capable of making honest and well-intentioned referrals, this is one relationship with the potential for conflicts of interest. In addition, ask for a sample inspection report and if it complies with ASHI standards.
Many companies also belong to statewide home inspection industry associations.
As a trade association, ASHI sets certain standards of practice, including what constitutes a thorough inspection, and enforces those standards along with a code of ethics for its members. It also sponsors continuing education. Although ASHI membership is a positive credential, membership alone does not make a good inspector. And don't necessarily turn a non-member away if they come highly recommended. Many worthy inspectors have yet to discover the cost-benefits of trade guild membership.