Borrowed from French chapeau, from Early Medieval Latin cappellus. Doublet of chapó (also from French), capelo (from Italian), and capillo (inherited).
Practice speaking and memorizing "chapeo" and many other words and sentences in Spanish.