Hard water has high mineral content. You know you have hard water if you get white buildup on things like faucets or tea kettles. Or you get lots of soap scum in the tub or shower that's hard to scrub off. Check out this map of the USA, most states seem to have pretty hard water If you're in doubt, you can order hard water test strips.
On your hair it can combine with your natural oils from your scalp and hair products to form an oily soap scum like film on your hair. Even sulfate shampoo can have trouble breaking this up.
So I went on vacation with some new product samples from Moptop and Jessicurl and they worked amazing! But when I got home, they suddenly turned my hair into a limp mess. I could feel gross oily areas near my roots.
I didn't know what to do, I tried sulfate shampoo and the oily spots persisted. Someone pointed out that since the thing that changed was the location, it might be the water. I did a hard water treatment and my curls bounced right back!
There is a lot of mixed messages online about the best way to remove the deposits. I did try sulfates, it did not work. I got the best results from an acidic treatment. I used the Malibu C Demineralizer treatment. This can be a bit harsh so I only use it once a month. Some people also use Ion Crystal Clarifying Treatment (available at Sally's), vinegar, or other DIY conconctions.
I try to wash my hair as little as possible to limit the need for clarifying. When I do wash, I use a sulfate-free hard-water shampoo called Malibu Hard Water (you can get Ion Hard Water at Sally's which is a cheaper dupe). It contains an ingredient (EDTA) that claims to reduce the ability of minerals to buildup.
I avoid getting styling products and conditioner at the roots as much as possible.
I had to ditch any cleansers with anything that could cause buildup. They are the worst problem because you use them directly on your scalp. Avoid cleansers with oils, guar gum, and polyquats. For me one of the worst culpruits it seems was my Broo Thickening Shampoo, I suspect the gums mixed with the hard water to produce a residue.
Shower filters do not soften water completely, but do remove some of the minerals. AquaBliss High Output Universal Shower Filter with Replaceable Multi-Stage Filter Cartridge is a popular choice.
These tend to be more expensive. You can install a whole-house one but the simplest one is the ShowerStick which is about $200.