What's the difference between p(Z, X=x) and p(Z|X=x)? I'm trying to understand variational inference, and I've found resources that mention $p(Z, X=x)$, where $Z$ is a latent random variable and $X$ is the observed random variable. (Here is one such example)
Is there a difference between $p(Z, X=x)$ and $p(Z|X=x)$? Let's consider a simple example: $X$ is a random variable of MNIST handwritten digit images, and $Z$ is the random variable for the actual digit class (i.e. if x is a picture of a hand drawn 7, z is 7)


(i.e. if x is a picture of a hand drawn 7, z is 7)

If $X$ is a picture of a hand drawn 7, then $Z$ is almost surely equal to $7$. That is,
$$P(Z=7|X = \text{image of a $7$}) \approx 1$$
A computer will see this region $X = \text{image of a $7$}$ as the red encircled area below
Adapted from: The Memory for Latent Representations: An Account of Working Memory that Builds on Visual Knowledge for Efficient and Detailed Visual Representations

If you have such an image then the probability for a 7 will be close to one. However... Obviously you will not have
$$P(Z=7 \text{ and }X = \text{image of a $7$}) \approx 1$$
That would mean that you are almost certainly are gonna have an image $X$ and a value $Z$ that is equal to 7. But what about all the other digits?
