Data availability

Genomic data can be found at DOI: 10.5281/zenodo.2436565. All other data are available in the main text or the supplementary materials; Permits for collections and accessing genetic resources in Brazil were issued by SISBIO #46555 – 5 and CNPq # 010936 /2014 – 9. Costa Rican collecting permits were issued by the Comisión Institucional de Biodiversidad (Institutional Biodiversity Committee, University of Costa Rica; Resolutions # 0 12 and 020; Material Transfer Agreement MTA VI-4307 – 2013) and authorized by La Selva Biological Station and Las Brisas Nature Reserve. A modified version of the southern pine beetle (Fig. 1) photo from Erich G. Vallery is used under the Creative Commons Attribution 3.0 License. Photos of Cyphomyrmex (Figs. 1 and 5) are used under a perpetual commercial license from Alexander Wild.

Received: 18 October 2018 Accepted: 11 January 2019