A cap is a hat that fits snugly on your head. You might wear a bathing cap when you swim, to keep your hair dry.
Many caps don't have brims, while hats often do. You can even describe someone's hair using the word cap: "She has a glossy cap of dark hair." Another kind of cap is a lid: "Put the cap back on the ginger ale or it'll go flat!" And to cap is to limit, as when a school caps the number of students at 500. The root is the Latin word caput, or "head."