$$X \longrightarrow \fbox{$\phantom{\int}P_{Y|X}\phantom{\int}$}\longrightarrow Y$$
The information capacity of this channel is $C=\max_{P_X} I(X;Y)$, and it. Any rate $C-\varepsilon$ can be achieved by fixing a large-enough blocklength $n$ and associating each message $m$$m\in \{1,\dots,2^{n(C-\varepsilon)}\}$ with a codeword $x^n_m\in \mathcal{X}^n$ with, each codeword component of $x^n_m$ i.i.d. $\sim P^\ast_X$ where $P^\ast_X$ is the distribution that maximizes $I(X;Y)$. If you choose your codewords in this way, then as long as $n$ is large and the total number of messages $m$ is less than $2^{n(C-\varepsilon)}$, then theThe distributions thethese codewords produce on the output alphabet $\mathcal{Y}^n$ are nearly alwaysprobably different enough from one another that the messageany observed output $m$ can be recovered with high probability$Y^n$ is only likely to have come from the outputtrue input $Y^n$$m$.
You can imagine choosing a codebook 'backwards' by choosinginstead building a collection of attainable output distributions: $$\{P_m\}_m\subset \{P: P = P_{Y^n|X^n}P_{X^n}\text{ for some }P_{X^n}\text{ over }\mathcal{X}^n\}$$
When $m$ must be sent, input $X^n$ distributed so that the output $Y^n$ is distributed like $P_m$
What are necessary and sufficient conditions on $\{P_m\}_m$ that ensure decoding error probability $\to 0$ as $n$ grows?