Case in point for anyone curious s to what this is about, here are a selection of maps of "Tarzan's Africa." Tarzan of the Apes by Edgar Rice Burroughs (who was American) came out in 1912, and Africa at the time looked like this.
Africa is a huge and geographically and ethnically diverse continent. Europeans who had actually traveled to Africa as explorers, merchants, missionaries, game hunters, mercantilists, etc. were aware of that. People at home, not so much. While Africa was no longer terra incognita by the 1910s, it was still very much "the Dark Continent" in the minds of British and American audiences.
This was emphasized in multiple media: the newspaper printings of Henry Morton Stanley "finding" David Livingstone in 1871 emphasized the swamp and forest ("jungle") in modern-day Tanzania; H. Rider Haggard's Allan Quartermain novels beginning with King Solomon's Mines (1885) and She (1887) were based on Haggard's experiences in South Africa, and set nebulously in the African interior with combinations of forest, highland, savannah, etc. Joseph Conrad's acclaimed Heart of Darkness (1899) was set in the Congo River Basin amid its rainforests.
Tarzan of the Apes was set in equatorial West Africa, which in the 1880s did have coastal rainforests. As the series progressed, Burroughs was not particular about the geography; neither were many other writers that set stories in Africa. Even ones that had been there such as Lord Dunsany on game-hunting expeditions felt free to place "jungle" where convenient (from a literary standpoint) rather than to keep their stories confined to the rainforests around the Congo River Basin and the Guinea Coast.
This is not to say that every Tarzan story, or every African story, was set in the jungle - but the idea became in the popular mind almost synonymous with Africa (and, in the racist 19th/20th century, with Africans and those descended from Africans - compare early denigrations of rock & roll in the United States as "jungle music.") So you see stereotypical "jungle" in the 1930s comic strips of Mickey Mouse and Tintin in the Congo, and when the 1930s Tarzan movies were filmed, they were filmed in the tropical foliage of Silver Springs, Florida - which tourist attraction included a "jungle cruise" ride.
This idea persisted for a long time in popular culture. Pulp magazines in the 1930s and 40s like Jungle Stories (1938-1954) also played their part, as did comic books - right through to the 1960s when the Black Panther and Wakanda were created by Jack Kirby and Stan Lee for Marvel comics. T'Challa's first solo feature was in Jungle Action #5 (1973), and as the name suggests, geographic and botanical accuracy was not high on the list of priorities.
So on and so forth. This is not to say that every story set in Africa, Tarzan or not, was set in the jungle - but a lot of them were, and to such a degree that the popular conception of the size and nature of Africa's rainforests has been greatly misjudged by many European and American audiences.
To amplify u/AncientHistory's answer somewhat, it's important not to overcredit the notion that "imperialist Europe" as a single intentional actor deliberately set out to represent Africa in any particular way with some particular end in mind--and yet at the same time understand that this misleading representation of African environments tells us a great deal about the nature of European interactions with Africans from the 17th Century onward, and part of what the image of jungle tells us is about the way that racist or negative views of Africa were cemented into Western culture.
The 19th Century European image of sub-Saharan Africa as "the Dark Continent", unknown to the rest of humanity, was an act of deliberate amnesia, often amplified by "explorers" who needed to make their travels sound more dramatic and pathbreaking. Between 1600 and 1800, Europeans actually developed a substantial knowledge of coastal West and Equatorial Africa as well as much of the East African coast and Madagascar. Much of it was practical knowledge, either about sustaining commercial ties with African societies (including but not limited to the slave trade) and sustaining trade routes to south and southeast Asia as well.
But even that earlier era of contact contributed a bit to the image of Africa-as-jungle in that the Atlantic trade in West and Central Africa was often situated in trading outposts that were in coastal mangrove swamps and lagoons where rainforest ecosystems were only a short distance inland--and these environments were frequently deadly to European sailors and merchants due to endemic diseases like malaria and yellow fever. Until the 19th Century, few Europeans travelled significant distances into rainforest societies like Asante, Benin or Oyo to understand them as inhabited, complex places. And the early Atlantic trade, which was focused more Senegambia and the kingdoms of Kongo and Angola, where environments weren't primarily rainforest, was much smaller in scale and much less described to European publics.
I think that's really the key thing to note: as early modern knowledge of sub-Saharan Africa was displaced by the much more bombastic racism of late 19th Century imperialism, Europeans also became avid consumers of explorers' narratives, "boys' own adventures", and so on set in "exotic locations"--exotic being defined as filled with stereotypical "natives" and as being environments that were unfamiliar and strange to your average European reader. More than a few explorers were happy to exaggerate and amplify the exotic character of rainforest environments--Henry Morton Stanley is one of the most notable but many others did it too--such that surviving and overcoming the jungle became a sign of the extraordinary capabilities of Europeans and a sign of their fitness for ruling the rest of the world--never mind that there were numerous successful, sophisticated societies that had built large communities and centralized states centered in rainforest environments throughout Central and Western Africa. It wasn't just popular culture, either-- a famous contributor to the envisioning of Africa as nothing but jungle is surely Conrad's Heart of Darkness, based on the novelist's brief experience of King Leopold's destructive ransacking of the Congo River basin.
An explorer (or imperial conqueror) who travelled across savannah, woodland or grassland didn't particularly excite the European imagination: those were familiar environments. Deserts like the Sahara and the Kalahari might fit the bill (and they did feature in some exoticizing treatments of sub-Saharan Africa) but 19th Century European popular culture assigned those environment to other kinds of "exoticisms".
From that point on, it is as u/AncientHistory describes it--if you wanted to set a story of adventure or melodrama in "Africa", you picked "jungle" because that's what your readers or viewers expected--even when the stock descriptions of "jungle" in popular culture weren't even very accurate to actual rainforest in Western or Central Africa, and the standard sets built for films like Abbott and Costello's "Africa Screams" used a mix of popular tropical plants in wide use in landscaping in southern California or elsewhere and plastic foliage of various kinds. In general, the only time this varied somewhat was in the template of "great white hunter" stories or other popular culture focused on game animals or game reserves, in which case the stereotypical "Africa" environment suddenly becomes a kind of faux-version of Serengeti--basically east African savannah and woodland.