# Markov kernel in simple random work

I am a very junior learner in this field. I read the wiki for Markov kernel:

The first example is a simple random walk with the Markov kernel $\kappa$:

$$\kappa(x,B) = \frac{1}{2}1_B(x-1)+\frac{1}{2}1_B(x+1), \\ \forall x\in \mathbb{Z}, \forall B \in \mathcal{P}(\mathbb{Z}), \ \ \text{power set of }\mathbb{Z}$$

which describes the transition rule for the random walk on $\mathbb{Z}$.

I am confused that how does this Markov kernel work?

For example, let $B = [-2,2]$ and then depict the $\kappa$ w.r.t. $x$. So $\kappa = 1$ when $x = [-1,1]$ and $\kappa = 0.5$ when $x = [-3,-1]$ and $x= [1,3]$ and $0$ otherwise. Is this what $\kappa$ only means?

Besides, according to "A question about Markov kernel definition.", $\kappa(\cdot,B)$ is a measurable function and $\kappa(x,\cdot)$ is a probability measure. It makes me confused to explain the above example according to this.

Note: I also read the following from one paper: $\kappa(x,B)$ is the probability that $x_{k+1}\in B$, knowing that $x_k = x$. I am also confused about how does this description relate to the above meaning of Markov kernel.

A Markov process with kernel $\kappa$ is a sequence of random variables $\ldots,X_{k-1},X_k,X_{k+1},\ldots$ (i.e., a process) such that for every measurable set $B$, we have $\mathbb{P}(X_{k+1}\in B\,|\,X_k,X_{k-1},\ldots)=\kappa(X_k,B)$ almost surely. More specifically, if the random variables $X_k$ take their values in a measurable space $(M,\mathscr{B})$, then $\kappa$ has to be a kernel $\kappa:M\times\mathscr{B}\to[0,1]$. With this interpretation, you can try to see that the kernel in your example indeed specifies a simple random walk on $\mathbb{Z}$.
In a more general scenario, suppose you want to prescribe a probabilistic relation between two random variables $X$ and $Y$ so as to specify the distribution of $Y$ given the value of $X$. If $X$ and $Y$ take their values in two finite (or countable) sets $M$ and $N$ respectively, we can simply specify the relation with a stochastic matrix $\kappa:M\times N\to[0,1]$, where $\kappa(x,y)$ represents the probability of $Y=y$ given $X=x$. When the $M$ and $N$ are not countable, we can still use kernels in a similar fashion as long as $M$ and $N$ are measruable spaces. Say, $(M,\mathscr{A})$ and $(N,\mathscr{B})$ are measurable spaces. A desired conditional distribution of $Y$ given $X$ can be given as a kernel $\kappa:M\times\mathscr{B}\to[0,1]$, where $\kappa(x,\cdot)$ (a probability measure on $N$) represents the distribution of $Y$ given $X=x$.