Many years ago, TSP, trisodium phosphate, was removed from laundry detergent. Since then, the detergent just doesn't get rinsed from clothes nearly as well. TSP holds dirt in suspension so it can be rinsed away. You can add TSP into your wash, 2tsp to 1/4 cup, and you will notice a difference. Especially with whites. It was removed because it is a sort of fertilizer that causes algae to grow in water. If your water is run off to lakes and streams, that matters. If it goes to a water treatment plant, not so much. If you are on a septic system, it doesn't matter one way or the other.
Lots to read about TSP and laundry detergent if you are interested.
Also, TSP was taken out of dishwashing detergent for same reasons. The main result is that glass gets a milky look to them after a while. It's told that is hard water, but it's just soap not getting rinsed well enough because too much soap is used because TSP was taken off the market in those products. Add 1 tsp to your dishwasher per load and within a few loads, your glasses will once again sparkle and look clear. TSP is available at just about any store that carries cleaning supplies. I get mine from Home Depot, but it's available at Walmart, Amazon, etc. A 1 pound box lasts me about a year or so. Since using it, I now have CLEAN clothes, use a lot less water and detergent to get those clothes clean as well. I also have clean dishes that sparkle. Cheers!