The geology that underlies a river or lake has a major impact on its chemistry. A river flowing across very ancient precambrian schists is likely to have dissolved very little from the rocks and maybe similar to de-ionised water at least in the headwaters. Conversely a river flowing through chalk hills, and especially if its source is in the chalk, will have a high concentration of carbonates and bicarbonates of Calcium and possibly Magnesium.
As a river progresses along its course it may pass through a variety of geological types and it may have inputs from aquifers that do not appear on the surface anywhere in the locality.