If M(x,y) dx + N(x,y) dy is exact, that means it equals dF for some function F(x,y). But the chain rule says that dF=\frac{\partial F}{\partial x}dx+ \frac{\partial F}{\partial y}dy, which implies that M(x,y) = \frac{\partial F}{\partial x} and N(x,y) = \frac{\partial F}{\partial y}. Now Clairaut's theorem states that (for well-behaved functions) the mixed 2nd partial derivatives are equal, i.e. \frac{\partial^{2}F}{\partial x \partial y}=\frac{\partial^{2}F}{\partial y \partial x}, which in terms of M and N becomes \frac{\partial N}{\partial x}=\frac{\partial M}{\partial y}. That's the condition for exact differentials.
I hope that helps.