Striking genetic structure among marine populations at small spatial scales is becoming evident with extensive molecular studies. Such observations suggest isolation at small scales may play an important role in forming patterns of genetic diversity within species. Isolation‐by‐distance, isolation‐by‐environment, and historical priority effects are umbrella terms for a suite of processes that underlie genetic structure, but their relative importance at different spatial and temporal scales remains elusive. Here, we use marine lakes in Indonesia to assess genetic structure and test relative roles of the processes in shaping genetic differentiation in populations of a bivalve mussel (Brachidontes sp.). Marine lakes are landlocked water bodies of similar age (6,000 – 10,000 years), but with heterogeneous environments and varying degrees of connection to the sea. Using a population genomic approach (double‐digest Restriction‐site Associated DNA sequencing), we show strong genetic structuring across populations (range FST: 0.07 – 0.24), and find limited gene flow through admixture plots. At large spatial scales (>1400km), a clear isolation‐by‐distance pattern was detected. At smaller spatial scales (<200km), this pattern is maintained, but accompanied by an association of genetic divergence with degree of connection. No signatures of isolation‐by‐environment were found. We hypothesize that (incomplete) dispersal barriers can cause initial isolation, allowing priority effects to give the numerical advantage necessary to initiate strong genetic structure. Priority effects may be strengthened by local adaptation, which our data potentially corroborates by showing a high correlation between mussel genotypes and temperature. Our study indicates an often‐neglected role of evolution‐mediated priority effects in shaping population divergence.