I'm currently having a confusion dealing with the conditional expectation. Let's recall the definition first:
Let $X$ be an integrable function (or a random variable) defined on a probability space $(\Omega,\mathfrak{M},\mu)$ and let $\mathfrak{A}$ be a $\sigma$-subalgebra of $\mathfrak{M}$. The conditional expectation of $X$ on $\mathfrak{A}$ is then defined to be an $\mathfrak{A}$-measurable function $\mathbb{E}(X|\mathfrak{A})$ which satisfies the identity $$\int_AXd\mu=\int_A\mathbb{E}(X|\mathfrak{A})d\mu $$ for any $A\in\mathfrak{A}$. The existence and uniqueness follow from the Radon-Nikodym theorem. Two special cases are as follows:
(1) If $X=\chi_{\omega}$ for some $\omega\in\mathfrak{M}$, $\mathbb{E}(\chi_{\omega}|\mathfrak{A})$ is called the conditional probability of $\omega$ (relative to $\mathfrak{A}$).
(2) If $\mathfrak{A}$ is the $\sigma$-algebra generated by a function $Y$, we write $\mathbb{E}(X|\mathfrak{A})=\mathbb{E}(X|Y)$.
Q1. Why is the conditional "probability" a function, not a number?
Q2. What is the intuitive meaning of $\mathbb{E}(X|Y)$?
As for Q2, I think that $\mathbb{E}(X|Y)$ should mean an expectation of $X$ provided that $Y$ happened (as in elementary probability theory); for example, the symbol $\mathbb{E}(X|Y=y)$ should indicate an expectation of $X$ when $Y=y$. However, I found it hard to connect this idea and the above definition. I'm not even 100% sure about this; anyway, $\mathbb{E}(X|Y)$ is a function, not an expectation (which is a number).
I'm familiar with measure theory, but not with probability theory. So any help would be appreciated! Thank you.