$$X \longrightarrow \fbox{$\phantom{\int}P_{Y|X}\phantom{\int}$}\longrightarrow Y$$ The information capacity of this channel is $\max_{P_X} I(X;Y)$, and it can be achieved by associating each message $m$ with a codeword $x^n_m\in \mathcal{X}^n$ with each codeword component 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(I(X;Y)-\varepsilon)}$, then the distributions the codewords produce on the output alphabet $\mathcal{Y}^n$ are nearly always different enough that the message $m$ can be recovered with high probability from the output $Y^n$. You can imagine choosing a codebook 'backwards' by choosing 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 sufficient conditions on $\{P_m\}_m$ that ensure decoding error probability $\to 0$ as $n$ grows?