This is a vintage undergraduate geology question, good one!
You have half the answer already from others. The components of table salt (sodium, chlorine) are in some rocks, and will dissolve. So over time they wash into the sea from rivers.
But the next half of the question is: loads of stuff in rocks will dissolve. A lot of it dissolves more readily than sodium and chlorine (e.g., calcium, phosphorus). So why is the sea table-salt-y specifically? *This* is because the other compounds are much more useful to critters and/or easy to incorporate into new rocks. So, most other things that are washed into the sea get taken out again pretty fast. Sodium and chlorine are much less (though not completely un-)useful, so they are the ones that build up to levels we can taste.
This is a classic “mass balance” question, where you have to think about what comes out as well as what goes in to get the full answer.
Latest Answers