Epistemology and ontology sometimes go hand in hand because people studying epistemology assume that objects exist, and ontology is the study of existing objects. Also, people studying ontology may study knowledge, which is the main focus of epistemology, but not in the same way that epistemologists do. Philosophers also use these two fields together in trying to determine certain things, like the location of knowledge.
People studying epistemology are focused on all aspects of knowledge. This includes what it is, how humans gain it and use it, and whether it is possible to know something completely or not. In doing this, they generally have to assume that objects exist so that they can study how people learn about them and know about them. Since ontology is the study of whether and how objects exist, epistemologists have to assume that some of the findings from ontology are true before they can start to make arguments about knowledge.
While epistemologists study the nature of knowledge, ontologists can also study it as well. They have a different focus, however; as they want to determine whether knowledge is an object or an idea. In ontological study, if knowledge is an object, then it must exist independently of the human mind, whereas if it is only an idea, then it can only exist subjectively in someone's mind. If this is true, then it raises questions about how two people can have the same knowledge about something — for instance, how two people can know that the Sun rises in the east. Despite the difference in focus, ontologists still use some of the concepts from epistemology when constructing arguments.
One philosophical debate in which epistemology and ontology are both used is that of whether knowledge exists objectively, or whether it's necessary to have a mind to have knowledge. For instance, if a person thinks of a certain characteristic about a cat, then a philosopher would want to know whether the knowledge of that characteristic exists in his mind, or whether it exists somewhere outside of his body.
This is also used to study how a person can lose knowledge without knowing it. For example, a person can know what time it is one day, but if he forgets to change the clocks for daylight savings time on the next day, then he will have lost that knowledge without knowing it, since he will still think that he knows the time, even though he's actually mistaken. Since philosophers define knowledge as always being true, they wouldn't say that person is mistaken or has false knowledge, but rather that he has lost the knowledge.
Additionally, both fields come into play in the study of whether ethical concepts like "Murder is wrong" exist in a person's mind or in society. If a concept only exists in a person's mind, then it raises the question of how certain moral concepts are very widespread in society and appear to be intuitive. If the concept exists in society, then a philosopher would try to find out how it can exist in a society outside of people's minds without actually being a physical object.