Mainly it comes down to molybdenum. 316 has 2 to 3% of it and 304 does not, and that is what gives 316 better resistance to pitting and crevice corrosion in chloride-heavy or acidic conditions. If it is just general indoor use, 304 is usually fine. Anywhere near saltwater, chemicals, or heavy cleaning agents, go with 316.
Hardness testing to ISO 6508-1

