$H^1(M,\mathbb{Z}_2)$ specifies the 1st cohomology class of manifold $M$ (can be regarded as spacetime) with $\mathbb{Z}_2$ coefficient,
it is often to see that we say the 1st Stiefel Whitney class
$$w_1 \in H^1(M,\mathbb{Z}_2), \tag{1}$$
However, it looks to me that when we discuss the spinor bundle (associated to fermion in physics), we also say that the fermion line is related to $H^1(M,\mathbb{Z}_2).$ For example, on the $d$-torus, we need to specify the spin structure on the torus (a spin manifold, with possibly the choice of $H^1(M,\mathbb{Z}_2)=H^1(T^d,\mathbb{Z}_2)=\bigoplus_d\mathbb{Z}_2$ along each $S^1$-circle direction.) In other words, we may say that roughly
$$\text{periodic and anti-periodic boundary condition of fermions} \in H^1(M,\mathbb{Z}_2),\tag{2}$$
Moreover, one way to understand the fermion moving along a 1-dimensional sub dimensional manifold, may be the spin bordism group generator, say $\eta$, where
$$\Omega^{1,Spin}(pt)=\mathbb{Z}_2,\tag{2},$$
where $\eta$ on a nontrivial 1-dimensional manifold generates the bordism group.
My question: So how are these eq.(1), (2), (3) are related? Or how are they not related? Can one clarify these with examples?
The set of isomorphism classes of spin structures on a spin manifold $M$ is a torsor over $H^1(M, \mathbb{Z}_2)$; what this means is that $H^1(M, \mathbb{Z}_2)$ acts freely and transitively on it, so the two can be identified but not canonically. An identification requires a choice of spin structure to act as the "origin." The $n$-torus happens to have a close-to-canonical choice of spin structure given by the one coming from its Lie group framing, so one can make a close-to-canonical identification in that case.
I don't know how this is related to fermions or spin bordism.