As a technology, Knowledge Graphs are a particular configuration and deployment of the technologies of the semantic web. Though the technologies are heterogeneous and vary widely, the common architectural feature is treating data as a graph rather than as tables as in relational databases. These graphs are typically composed of triplet links or "triples" - subject-predicate-object tuples (again, this is heterogeneous) - that make use of controlled vocabularies or schemas.
These seemingly-ordinary data structures have a much longer and richer history in the semantic web. Initially, the idea was to supplement the ordinary "duplet" links of the web with triplets to make the then-radically new web of human-readable documents into something that could also be read by computers. The dream was a fluid, multiscale means of structuring information to bypass the need for platforms altogether - from personal to public information, we could directly exchange and publish information ourselves.
Needless to say, that didn't happen, and the capture of the web by platforms (with search prominent among them) blunted the idealism of the semantic web.