You’re conflating several issues. There’s Dungeons & Dragons (in its various editions), the d20 System, the d20 System Trademark License (with associated d20 System Trademark Guide), the Open Game License, and System Reference Documents. You didn’t raise any concerns about it, but the Game System License is also a part of this story.
The d20 System
The d20 System is a system of rules, originally based on D&D 3e and updated in parallel with D&D 3.5e. The rules of the d20 System were described in a System Reference Document (SRD), which at the time was simply known as the SRD (though that term has since also been used by other publishers, as well as by Wizards of the Coast for 5e, though the 5e SRD has nothing to do with the d20 System).
An aside: “a d20 system”
A concern about capitals was raised regarding “d20 System” vs. “d20 system.” As a name, “d20 System” is a proper noun and thus is capitalized (well, except for the “d,” but that’s a specific notation rather than typical English grammar). The phrase “d20 system” could, instead, refer to just any system that primarily uses a d20 for things, so you could describe a whole lot of systems that have absolutely nothing to do with the d20 System as “d20 systems”—but, perhaps due to the potential for confusion, I don’t see a lot of people doing that.
The Open Game License
The SRD, and thus the d20 System, were (and remain) intellectual property of Wizards of the Coast. In order for other publishers to use this content without infringing upon Wizards of the Coast’s copyright, they needed a license to use it. That license was the Open Game License (OGL), since Wizards of the Coast released the entire SRD (and thus the d20 System) under that license. This meant other publishers could agree to that license, and so long as they obeyed its requirements (including a copy of the OGL with their product, respecting “Product Identity,” and so on), they could use copyrighted material from the SRD in their own products.
No edition of D&D is based on the d20 System, but rather things are the other way around. Wizards of the Coast makes this explicit in their d20 System Trademark FAQ:
Q: What is meant by the term "d20 System"?
A: The term refers to the game engine used in Wizards of the Coast's hobby gaming roleplaying game. It is the basis for Dungeons & Dragons, Star Wars, and other products currently released or in development. The "d20 System" trademark consists of the words "d20 System" and the "d20 System" logo. Additional information about the trademark can be viewed at: www.uspto.gov, by searching for "d20 system".
Q: What parts of Dungeons & Dragons are Open Game Content?
A: None of the Dungeons & Dragons product line is Open Game Content. Currently the only Open Game Content released by Wizards of the Coast is the System Reference Document.
Q: What parts of d20 Modern are Open Game Content?
A: None of the d20 Modern product line is Open Game Content. Open Game Content from d20 Modern can be found in the Modern System Reference Document (ñMSRDî) [sic].
Q: What parts of Star Wars are Open Game Content?
A: None of the Star Wars roleplaying game is Open Game Content.
Q: What parts of Call of Cthulhu and Wheel of Time are Open Game Content?
A: No part of these games is Open Game Content.
Q: What about earlier editions of D&D?
A: No earlier editions of D&D are, or will be, released as Open Game Content.
Note that at the time this FAQ was published, D&D 3.5e was the latest version of D&D. None of this applies to D&D 4e or 5e, which aren’t related to the d20 System in any way.
However, while no edition of D&D is licensed under the OGL, other games are—most notably, perhaps, pretty much all of Pathfinder 1e’s mechanical parts are based on the d20 System, and are in turn themselves licensed under the OGL. Though Pathfinder 1e is based on the d20 System, it does not use the d20 System logo (see below), and so whether you want to call it a d20 System game or not is kind of a semantic argument. (Basically, since Pathfinder rewrites several facets of the d20 System, the argument is that it’s not a d20 System product because it isn’t compatible with d20 System—which is fair enough.) Pathfinder 2e no longer uses the d20 System, but it is still largely available under the OGL.
The d20 System Logo and the d20 System Trademark License
Products associated with the d20 System used the d20 System logo, reproduced here under Fair Use (educational, non-profit, etc.):
Wizards of the Coast not only has copyright to this image, but they also claim it as a trademark. That means (they claim) this logo is meant to indicate to consumers that a product is part of or compatible with the d20 System, and it may not be used for other purposes. So in order to include this mark on a product, one needed to license the logo. The standard license for doing so was the d20 System Logo Trademark License—the text of which no longer seems to be available (at least, the wizards.com links for it are dead). Many other publishers would license this logo so that they could market their products as being part of the d20 System.
This licensing scheme is precisely why I am explicitly calling out my usage of the logo as Fair Use—I have not agreed to that license (indeed, I cannot even find the text of the license in order to figure out what agreeing to it entails), so my use of the logo is unlicensed—in this case (I argue), a protected, allowed form of unlicensed use known as Fair Use (in the USA; most countries have analogous concepts but may have different names for it and they may vary in the details).
The Dungeons & Dragons logo (as used in 3e products)
The d20 System logo is distinct from the Dungeons & Dragons logo found on products published by Wizards of the Coast, and a few other products, during 3e. Again reproduced under Fair Use:
This is also Wizards of the Coast copyright and trademark, but there was no standardized license available for this logo. In order to use it, you had to work out a license with Wizards of the Coast privately. It is not known what the terms of these licenses were (they probably usually involved paying Wizards of the Coast a certain amount of money), but they were all specific to a particular product.
D&D 4e and the Game System License
No part of D&D 4e is available under the Open Game License. In lieu of OGL content, some 4e content was made available under the Game System License, which is very restrictive. Very little third-party work was performed under the GSL. Kenzer and Co. famously released their 4e content without licensing anything under the GSL—instead, they were just very careful about what they used with respect to copyright law, which they could do because their founder is a noted copyright expert. Wizards of the Coast never sued them for copyright infringement, so presumably they did it “right.” (In fact, in the past, it had been Kenzer who sued Wizards of the Coast for their infringement of his copyright, namely some comics in Dragon magazine that they re-published in a compilation volume without his permission. This is why 3e Kenzer products could use the Dungeons & Dragons logo instead of the d20 System logo—they won the right to do so as part of the settlement for this case.)
D&D 5e and the Open Game License again, but not d20 System
D&D 5e has published a new SRD, again available under the OGL, but only a very limited portion of 5e is featured in it. For many aspects of the game, only one example of a thing is available as open-game content—it mostly serves as enough of a foundation for third-party publishers to write their own examples following that baseline, rather than potentially serving as a resource for players to actually play the game (as the SRD did for 3e and 3.5e).