The order of ontology is not the same as the order of epistemology. In fact they are inversions of each other. What is ontologically basic is not epistemologically basic and vice versa. Let’s divide reality into three levels: elementary objects, middle sized objects, and sentient objects: the first level constitutes the second, which constitutes the third. There are many names for this relation of ontological derivation: grounding, supervenience, dependence, composition, emergence, etc. Some things are more basic than others, ontologically speaking: you can’t have the non-basic things without the basic things, but the basic things don’t presuppose the non-basic things. The epistemological order is the reverse of this: knowledge of mental states is the most basic, followed by knowledge of middle sized objects, followed by knowledge of elementary objects. We know our own states of mind best, perceptible objects second best, and atoms third best (or whatever atoms are made of). This fact gives rise to a lot of philosophy, because we are least certain about the things that are most basic. Descartes’s entire philosophy is motivated by this. We have to start with the topmost layer of reality and then work our way down. Not all philosophy sees things this way: some philosophy tries to align the two orderings. Thus we are instructed to regard sense data as ontologically basic as well as epistemologically basic: everything is made of mind, including atoms. The mind constructs reality; reality does not construct the mind. In effect, the mind furnishes the atoms of reality. But this position is not common these days; now we tend to suppose that the ontological order is the reverse of the epistemological order.
Is this a necessary truth? The question is seldom (if ever) asked. Must all knowing beings start with sense data and work out to ordinary objects and elementary objects? Must every conceivable epistemology invert ontology? Apparently not: we can imagine beings that start with knowledge of atoms and work out to middle sized objects and minds. Think of Leibniz’s analogy of the mill: nano-beings that know the interior of the atom like the back of their hand but have to infer the rest from that basis. These beings have no direct acquaintance with tables and chairs and don’t introspect their own minds, but they aspire to know about these things by inference from what they are directly acquainted with. For them ordinary objects are conjectural and the existence of minds is a subject of heated debate—sense data and the like are mere posits so far as they are concerned. If you think this isn’t possible because they have minds themselves and hence must know of their existence introspectively, then imagine that our nano-beings don’t have minds: they are non-conscious epistemic agents.  Or we can suppose that they have minds very different from the minds we are familiar with, which they know about directly, but that they also posit other minds of the kind we know about directly: that is, they postulate minds like ours based on evidence drawn from their knowledge of matter. In other words, their epistemology recapitulates ontology, while ours does not. In their community there is no Descartes convinced of the existence of mind but uncertain about matter; rather, the atom is the most certain of things while everything else is shrouded in doubt. Their equivalent of the evil demon is misleading them about everything except the nature of atoms. They may not enjoy absolute certainty about the existence of atoms, but they regard this area of knowledge as more secure than all other areas—justifiably given their epistemic make-up.
This means that our human epistemology is contingent: not every epistemology inverts ontology. The epistemological problems that face us don’t face every knowing being, and other beings may have problems we don’t have. For example, some beings may have trouble formulating the Cogito, because they don’t have introspective access to their own thoughts and may never have formed the idea of the self. We know that we think because we have the faculty of introspection, but not every possible thinking being is like this; indeed many animals appear to be in this case. One can only formulate the Cogito if one possesses the requisite concepts, but that is not a logical necessity. My nano-beings have a specific set of epistemic faculties unlike our own, so they must contrive an epistemology suitable to their situation. There is no universal epistemology, no one-size-fits-all; it all depends on contingent psychological make-up. In our case evolution has given us a capacity to know our own mental states and an ability to make inferences from them, but this is not universally shared even among knowing terrestrial animals. We know the most high-level things most easily, while low-level things are known only with time and effort. Other epistemic beings might have a more natural way of knowing reality, starting from the bottom up. Their philosophers will shape their epistemology accordingly.
One of the curiosities of human epistemology is that we know our own minds very well but not the minds of others. We therefore have a problem about our knowledge of other minds. This is a case in which a high level phenomenon is known poorly, because we are not hooked up to other minds as we are hooked up to our own. But this too is contingent, since we can imagine ways in which minds could merge so as to allow surer knowledge of other minds: for example, bits of our brain might be inserted into other people’s brains in such a way that their mental states are directly known to us. It is only a contingent fact that we have a problem of other minds, though no doubt a deeply entrenched one, biologically speaking (our brains are isolated from other brains). I think this helps in easing the pressures caused by epistemological problems: they are not problems about knowledge as such, or about knowledge of this or that subject matter as such, but problems arising from contingent human faculties. We are only one small part of reality and how things are for us is not the measure of how things must be for everybody. We just happen to have this particular epistemology. 
 They might only have unconscious minds, so that their existence is conjectural. The epistemic system might not be accessible to consciousness. There is no necessity that knowing beings have conscious minds like ours.
 If we had been raised in an atomic environment like the nano-beings, no doubt we would have had a different epistemological profile—rather as microorganisms have a different epistemological profile from ours. Bacteria are well acquainted with other bacteria, though we know about them only indirectly. At the far end of the spectrum we have possible beings with only unconscious minds but intimate knowledge of other minds and even acquaintance with quarks. The logical possibilities are endless.