TITLE: How are the Tate-Shafarevich group and class group supposed to be cognates?
QUESTION [24 upvotes]: How can one consider the Tate-Shafarevich group and class group of a field to be analogues?

I have heard many authors and even many expository papers saying so, class group as far as I know is the measure of failure of unique factorization of elements (in some sense) in a ring.
 On the other hand the TS-group is $Ш(E/K)=\mathrm{Ker}(H^1(K,E)\mapsto \prod_{v}H^1(K_v,E))$ for a number field K. How can one compare them? I mean, how can one proceed comparing the failure of unique factorization to failure of Hasse-principle?
Any help regarding good articles about the Hasse-principle and BSD conjectures is also appreciated.

REPLY [4 votes]: One has (ignoring the contribution of the infinite places) $Ш(A/K) = \mathrm{H}^1_\mathrm{et}(\mathcal{O}_K,\mathscr{A})$ and $\mathrm{Cl}(\mathcal{O}_K) = \mathrm{H}^1_\mathrm{et}(\mathcal{O}_K,\mathbf{G}_m)$.