It seems to be a common view that the doctrine of middle knowledge basically holds (1) that counterfactuals of freedom can be true; and (2) that God knows them. This, however, is certainly not right. (1) and (2) are not sufficient for accepting middle knowledge. Strictly speaking, in fact, they don't even seem to be necessary; positions that involve middle knowledge but reject (1) or (2) are not at all attractive for a number of reasons, in part because they seem to make middle knowledge a pointless postulate, but there is nothing inconsistent about such a view.
To understand what middle knowledge is, you have to understand what it is in the middle of. Everyone agrees that God has two kinds of knowledge. The first is sometimes called natural knowledge and sometimes called knowledge by simple intelligence. This is knowledge of things insofar as they are possible; it is called 'natural knowledge' because God is usually said to know these by virtue of the divine nature. The second, sometimes called free knowledge and sometimes called knowledge of vision, is knowledge of things insofar as they are actual. It is called 'free knowledge' because God is usually said to know these by virtue of the divine will, i.e., God knows them by virtue of His choices. There are positions that deny one or the other, but in general everyone accepts these.
To have a middle knowledge position you must hold that this division is incomplete. There is a third, distinct sort of knowledge in between these two: a knowledge of X that is a bit more than knowledge of X as possible and a bit less than a knowledge of X as actual, but is not reducible to any combination of the two. We know in the case of a lot of counterfactuals that it is possible to reduce these to a combination of natural knowledge and free knowledge, because they can be known 'in their causes' -- i.e., given such-and-such actual things, only such-and-such other things are possible. Someone who accepts scientia media holds that there are counterfactuals -- usually counterfactuals of freedom -- that cannot be reduced in this way.
Suppose David does not go to the store. What do we say about this claim:
(D) Had David gone to the store, he would have freely chosen not to buy ice cream.
(We are assuming a freedom that involves alternative possibilities; if this conception of freedom were rejected, there would be no dispute: middle knowledge would be unnecessary, since counterfactuals of freedom would be analyzable in the way any other counterfactual would be.) One way to handle (D) would be to hold that this falls within the jurisdiction, so to speak, of natural knowledge and it alone. If this is so, then usually one would want to say that (D) is neither true nor false; it is merely a possible state among several; or, if it is understood to exclude other possibilities (e.g., Going to the store and choosing to buy ice cream), it is false, because while we can say that David might have bought ice cream had he gone, to say he would have done so leaves out the other things he could have done.
Alternatively one could say that it can be handled by a combination of natural knowledge and free knowledge. Then we can say that (D) is true, but only conditionally so. Most counterfactual statements are only conditionally true (i.e., they are only true ceteris paribus or on the supposition that there is no impediment), so this is not obviously problematic. If I say, "If I had the materials for peanut butter sandwiches, I would be able to make peanut butter sandwiches," this ordinary counterfactual is clearly true on condition that there'd be no other impediment (besides lack of materials) -- e.g., that I wouldn't be suddenly struck with paralysis or something. That is, it is true on supposition that other things are true; it is true, given certain background information.
What the true proponent of middle knowledge argues is that this is not enough. Traditional Molinism, for instance, held that statements like (D) were conditionally true; and they held that the conditions were true but not conditionally so. So, while (D) is only true if certain conditions prevail (namely, a given 'order of nature'), those conditions do prevail. However, they are not known to prevail by virtue of anything that we find in either an account of natural knowledge or an account of free knowledge, or their combination; so, since God knows all truths, we must be missing a type of knowledge, one that is in some ways like natural knowledge (it covers more than what is actual, since it includes counterfactuals) but is in other ways like free knowledge (it admits of contingent truths), but is a distinct type of knowledge falling in between the two. It is open to certain kinds of anti-Molinists to accept that (D) is conditionally true and accept that the conditions are true unconditionally, but to deny the last point, arguing that this can be adequately explained by natural knowledge (e.g., some supercomprehension views) or by free knowledge (e.g., physical premotion) or some combination of the two. The Molinist has to argue that neither natural knowledge nor free knowledge nor their combination can explain this knowledge of this type of counterfactuals.
This, incidentally, is why Molinists cannot avoid facing the grounding objection. The grounding objection is just one specific version of a larger worry about middle knowledge, namely, that it is otiose, and that people who posit it are either proposing an explanation for something that doesn't need an explanation (because there is not really anything to explain), or are proposing a superfluous explanation, i.e., an explanation for something that already is explained by a factor everyone already agrees is there. In other words, the Molinist has to have an answer to the grounding objection because he has to show that there really is a tertium quid between natural knowledge and free knowledge that isn't reducible to some combination of the two. And this is usually where Molinists are weak.