Initially, Stiefel-Whitney classes are only defined for smooth manifolds (if the manifold is not smooth, it doesn't have a tangent bundle). However, Wu's theorem states that $w = \operatorname{Sq}(\nu)$ and we can use this as a definition of Stiefel-Whitney classes for topological manifolds; in particular, $w_4(M)$ is defined even if $M$ does not admit a smooth structure or even a PL structure.
Freedman's Theorem states every non-degenerate bilinear form $b$ arises as the intersection of a closed, simply connected four-manifold. Moreover, if $b$ is even, there is a unique such manifold up to homeomorphism, and if $b$ is odd, there are two up to homeomorphism and they are distinguished by the Kirby-Siebenmann invariant.
As $E_8$ is an even form, there is a unique (up to homeomorphism) closed, simply connected four-manifold with intersection form $E_8$; we denote it by $M_{E_8}$.
As $(1)$ is an odd form, there are (up to homeomorphism) two closed, simply connected four-manifolds with intersection form $(1)$. One is $\mathbb{CP}^2$ which has zero Kirby-Siebenmann invariant (it admits a smooth structure and hence a PL structure). We denote the other manifold by $*\mathbb{CP}^2$ and note that it has non-trivial Kirby-Siebenmann invariant.
Recall that for a closed smooth four-manifold $M$, the Stiefel-Whitney number $\langle w_4(M), [M]\rangle$ is the mod $2$ reduction of the Euler characteristic $\chi(M)$; this is Corollary $11.12$ of Milnor and Stasheff's Characteristic Classes. The same is true for topological manifolds (using the definition of Stiefel-Whitney classes outlined above), see this question.
With all of this in mind, we can now see that $\operatorname{ks}(M)$ and $w_4(M)$ are unrelated as the following table demonstrates.
$$
\begin{array}{c|cc}
M & \operatorname{ks}(M) & w_4(M)\\
\hline
S^4 & 0 & 0 \\
\mathbb{CP}^2 & 0 & \neq 0 \\
M_{E_8} & \neq 0 & 0 \\
*\mathbb{CP}^2 & \neq 0 & \neq 0
\end{array}
$$
If the four-manifold $M$ admits a PL structure, then $\operatorname{ks}(M) = 0$, but the converse is not true. For example, $M_{E_8}\# M_{E_8}$ has trivial Kirby-Siebenmann invariant but it does not admit a PL structure (every PL manifold of dimension less than or equal to $7$ is smoothable, but $M$ is not smoothable by Donaldson's theorem). The class $w_4(M)$ has nothing to do with the obstructions to admitting a PL structure (both $S^4$ and $\mathbb{CP}^2$ admit PL structures).
You are confusing two things. I will try to explain the two points clearly and then afterwards explain your confusion.
Suppose $\alpha$ is a way of assigning a cohomology class to each rank $n$ oriented vector bundle $\alpha(E) \in H^k(M;\Bbb Z_2)$ which is the same for any two isomorphic bundles and natural under pullback: $\alpha(f^*E) = f^* \alpha(E)$.
Thm: there is a cohomology class $\beta \in H^k(BSO_n; \Bbb Z_2)$ so that, for the classifying map $f_E: X \to BSO_n$ with $f_E^*(\tau_n) \cong E$ we have $\alpha(E) = f_E^* \beta$.
Proof: set $\beta = \alpha(\tau_n)$. Then naturality shows that $$\alpha(E) = \alpha(f_E^* \tau_n) = f_E^* \alpha(\tau_n) = f_E^* \beta.$$
So this just amounts to the fact that $BSO_n$ classifies rank $n$ oriented vector bundles. Characteristic classes of oriented rank $n$ vector bundles are cohomology classes of $BSO_n$.
Now it is a calculation that $H^2(BSO_n; \Bbb Z_2) = \Bbb Z_2$. One of these elements is zero, the other is $w_2$. If you have a characteristic class of rank $n$ oriented vector bundles, either it is zero, or it is the nonzero class --- which is hence $w_2$.
It thus suffices to show that your characteristic class $a(E)$ is nonvanishing in some example.
What you are confused about is more general. The above explains why characteristic classes of vector bundles (let's drop the rank and orientation condition and say characteristic classes of vector bundles up to stabilization) come from the cohomology of $BO$.
The axioms you are thinking of help us to pin down specific classes in the cohomology of $BO$.
It can be phrased in the following funny way. The cohomology $$R = H^*(BO;\Bbb Z_2)$$ is a ring under cup product. The Big Theorem is that $R$ is a polynomial algebra on some specific elements that we like to call $w_1, w_2, \cdots$. But what is special about these elements? $R$ is also a polynomial algebra on the elements $w_1, w_2 + w_1^2, w_3 + w_1^3, \cdots$
The point is that $R$ is also has another structure, called being a 'coalgebra', arising from the sequence $$H^*(BO) \to H^*(BO \times BO) \to H^*(BO) \otimes H^*(BO).$$ The second map is an isomorphism (the inverse of the Kunneth isomorphism). The first map arises as pullback of the continuous map $P: BO \times BO \to BO$, given by `direct sum of vector bundles': if $f_E: X \to BO$ and $f_F: X \to BO$ classify the bundles $E$ and $F$, respectively, then $P \circ (f_E, f_F)$ represents the bundle $E \oplus F$. (P stands for 'plus'.)
I will call this structure $P^*$.
Then the classes $w_1, w_2, \cdots$ are uniquely determined by the fact that $$P^*(1 + w_1 + w_2 + \cdots) = 1 \otimes 1 + (w_1 \otimes 1 + 1 \otimes w_1) + (w_2 \otimes 1 + w_1 \otimes w_1 + 1 \otimes w_2) + \cdots$$
This is a fancy algebraic phrasing of the Whitney sum formula.
In summary: If you have a characteristic class (cohomology class assigned to vector bundle, natural under pullback) you just need to determine which one it is, by evaluating it on some bundle --- the universal bundle will do.
If you want to define Stiefel-Whitney classes you need to pin down more than that because, say, $H^{17}(BO;\Bbb Z_2)$ is very large and it's not clear which class deserves the name $w_{17}$. For $H^2(BSO_n;\Bbb Z_2)$ there is only one nonzero class --- no such trouble.
Best Answer
Spin structures and the second Stiefel-Whitney class are themselves not particularly simple, so I don't know what kind of an answer you're expecting. Here is an answer which at least has the benefit of being fairly conceptual.
First some preliminaries. Recall that a real vector bundle of rank $n$ on a space is the same thing as a principal $\text{GL}_n(\mathbb{R})$-bundle (namely its frame bundle) and that principal $G$-bundles are classified by maps into the classifying space $BG$. In particular, a smooth manifold $M$ of dimension $n$ has a tangent bundle which has a classifying map $M \to B\text{GL}_n(\mathbb{R})$. Additional information allows us to reduce the structure group of this classifying map as follows:
Now, what does this have to do with the second Stiefel-Whitney class? First let me tell a simpler story about the first Stiefel-Whitney class. The first Stiefel-Whitney class is a cohomology class $w_1 \in H^1(B\text{O}(n), \mathbb{F}_2)$ giving a characteristic class for $\text{O}(n)$-bundles which vanishes iff those bundles can be reduced to $\text{SO}(n)$-bundles. Why?
One reason is the following. $w_1$ can be regarded as a homotopy class of maps $B \text{O}(n) \to B \mathbb{Z}_2$ (where I use $\mathbb{Z}_2$ to mean the cyclic group of order $2$). Now, it's known that any such map comes from a homotopy class of maps $\text{O}(n) \to \mathbb{Z}_2$, and there's an obvious candidate for such a map, namely the determinant. This gives an exact sequence
$$1 \to \text{SO}(n) \to \text{O}(n) \to \mathbb{Z}_2 \to 1$$
which, after applying the classifying space functor, gives a homotopy fibration
$$B \text{SO}(n) \to B \text{O}(n) \xrightarrow{w_1} B \mathbb{Z}_2$$
exhibiting $B \text{SO}(n)$ as the homotopy fiber of the first Stiefel-Whitney class.
The homotopy fiber of a map between (pointed) spaces is analogous to the kernel of a map between groups; in particular, if $w : B \to C$ is a map of groups, then a map $f : A \to B$ satisfies $w \circ f = 0$ if and only if $f$ factors through a map $A \to \text{ker}(w)$. The same kind of thing is happening here: a classifying map $f : M \to B \text{O}(n)$ satisfies that $w_1 \circ f$ is homotopic to a constant map if and only if it factors up to homotopy through the homotopy fiber $M \to B \text{SO}(n)$.
Now the reason I gave such a sophisticated description of orientations is that the story for spin structures is completely parallel. Namely, the second Stiefel-Whitney class is a cohomology class $w_2 \in H^2(B\text{SO}(n), \mathbb{F}_2)$ which can be regarded as a homotopy class of maps $B \text{SO}(n) \to B^2 \mathbb{Z}_2$. You can produce such classes by applying the classifying space functor to a homotopy class of maps $\text{SO}(n) \to B \mathbb{Z}_2$, or equivalently a cohomology class in $H^1(\text{SO}(n), \mathbb{F}_2)$, and there's a natural candidate for such a class, namely the cohomology class classifying the nontrivial double cover $\text{Spin}(n) \to \text{SO}(n)$. This also turns out to imply that we get a homotopy fibration
$$B \text{Spin}(n) \to B \text{SO}(n) \xrightarrow{w_2} B^2 \mathbb{Z}_2$$
exhibiting $B \text{Spin}(n)$ as the homotopy fiber of the second Stiefel-Whitney class, and if you believe this then it again follows from the universal property of the homotopy fiber that a map $f : M \to B \text{SO}(n)$ lifts to a map $M \to B \text{Spin}(n)$ iff $w_2 \circ f$ is homotopic to a constant map.
(This homotopy fibration is a "delooping" of the more obvious homotopy fibration $B \mathbb{Z}_2 \to B \text{Spin}(n) \to B \text{SO}(n)$ coming from the short exact sequence $1 \to \mathbb{Z}_2 \to \text{Spin}(n) \to \text{SO}(n) \to 1$.)
This argument can be continued all the way up the Whitehead tower of $B \text{O}(n)$; the next step is a string structure, etc.