The word comes from philosophy, where ontology studies what exists. In computing it means the same idea made practical: an explicit list of the things in a domain and the rules connecting them.
For AI, an ontology is grounding. Language models generate fluent text but hold no fixed notion of what a term means in your organisation. An ontology fixes that meaning, so a system can resolve a phrase to a defined entity and trace its answer back to source.