Ontology is defined in the study of philosophy and metaphysics as the study of being and existence. It refers to entities, their relationships, and how they are grouped.
Say, this reminds me of "domain entities" in computer science. How do we define a thing? An object, a data type, a relation, a program, or an abstraction? Ontology in Computer Science derives the meaning of said "things" and their existence.
"In the context of computer and information science, an ontology defines a set of representational primitives with which to model a domain of knowledge or discourse."
— Tom Gruber from Ontology, 2007
Tom elaborates further: "An ontology defines [...] the concepts, relationships, and other distinctions relevant to modelling a domain," which is why we call these abstract types "entities."
Outside of software, Stanford defines two ontologies relevant to computer science:
"[...] Computational systems are typically viewed as consisting of two ontologically distinct entities: software and hardware. Algorithms, source codes, and programs fall into the first category of abstract entities; microprocessors, hard drives, and computing machines are concrete, physical entities."
— Stanford Philosophy, 1.1 Software and Hardware