The following is a definition taken from Introduction to Modern Cryptography by Katz and Lindell.
I'm having a hard time understanding some basic concepts! Can you please help me? $\newcommand{\Gen}{\operatorname{Gen}}\newcommand{\Enc}{\operatorname{Enc}} \newcommand{\Dec}{\operatorname{Dec}}$
Consider the following experiment for any private-key encryption scheme $Π=(\Gen,\Enc,\Dec)$, adversary $A$, and value $n$ for the security parameter. The CCA indistinguishability experiment PrivK:Aan (n) is:
A key $k$ is generated by running $\Gen (1^n)$.
The adversary $A$ is given input $1^n$ and oracle access to $\Enc_k (·)$ and $\Dec_k (·) $. It outputs a pair of messages $m_0, m_1$ of the same length.
A random bit $b\in \{0,1\}$ is chosen, and then a ciphertext $c = \Enc_k(m_b)$ is computed and given to $A$. We call $c$ the challenge ciphertext.
The adversary $A$ continues to have oracle access to $\Enc_k (·)$ and $\Dec_k (·)$, but is not allowed to query the latter on the challenge ciphertext itself. Eventually, $A$ outputs a bit $b'$.
The output of the experiment is defined to be 1 if $b' = b$, and 0 otherwise.
In the second bullet point what does "It outputs a pair of messages" mean? Who and where does it output those messages? Does the adversary output the messages? The oracle?
What's the purpose of the random bit b?