Doing this mechanically RAW, is probably impractical:
- At first glance, the third level spell Plant Growth could be what you're looking for
Plant growth is a third level spell on both the Druid and Ranger spell list, so available at 5th level, at the earliest. A character casting this spell repeatedly, might be able to create the effect that you want to achieve.
Casting Time: 1 action or 8 hours
Range: 150 feet
This spell channels vitality into plants within a specific area. There are two possible uses for the spell, granting either immediate or long-term benefits.
If you cast this spell using 1 action, choose a point within range. All normal plants in a 100 foot radius centered on that point become thick and overgrown. A creature moving through the area must spend 4 feet of movement for every 1 foot it moves. You can exclude one or more areas of any size within the spell’s area from being affected.
If you cast this spell over 8 hours, you enrich the land. All plants in a half mile radius centered on a point within range become enriched for 1 year. The plants yield twice the normal amount of food when harvested.
(SRD p. 169)
As you can see, there are two ways it can be cast, with effects that I have assumed are exclusive to each method of casting (i.e. the 'eight hour' casting doesn't additionally produce the effects of the 'one action' casting).
You asked for a means of creating 'near impenetrable vegetation'. Plants that slow movement by three-quarters, seem to meet that criteria.
This spell also occurs instantly, and has no stated conditions (unlike Entangle) by which the vegetation later withers. So the limiting factor is how many times you'd need to cast the spell to cover your desired area.
- But how many times would (the one action version of) Plant Growth need to be cast, to achieve the desired effect?
You stated that you'd like this area to be 'a few miles in radius', so let's start by calculating how many castings of the spell would be needed per square mile.
- Every time the spell is cast it affects an area of radius 100 ft.
- A circle or radius 100 feet contains 31416 square feet (rounded up).
- A square mile contains 27878400 square feet.
- So, you'd need to cast the spell approximately 887 times, per square mile.
- It would take a level 20 druid at least 60 days to cover one square mile using Plant Growth. That's assuming they use all 15 spell slots they have, of third level or higher, to cast Plant Growth and take one long rest, every day.
- (Note: it would actually take much longer than this. Circles tessellate very poorly, so casting areas would need to overlap each time if you wanted to not miss bits out)
Multiple Druids and or Rangers working together, could obviously achieve this effect more quickly. However, any high level casters you add to your game add extra complication to it.
An easier and perhaps more reasonable solution would be to adjust your expectation of how large this area needs to be. What are the motivations of the characters that are spending all day, every day casting this same spell over again?
- What about the other (eight hour casting time) way of casting Plant Growth?
If you go with the eight hour casting of Plant Growth rather than the one action casting you can affect a much wider area each time. A circle of half mile radius is equal to 0.79 square miles. Therefore it would be easy for one relatively low level caster to affect an area 'a few miles in radius' over a period of months.
This method of casting does not produce difficult terrain. So, if that's what you want when you say 'near impenetrable vegetation' then this solution will not work for you. As DM, however, you could rule that the 'enriched' growth of the plants still makes them a good place for someone nefarious to hide. If all you need is a good hiding place then this could be enough.
But why not forget about RAW, and homebrew a solution?
There are lots of ways that you could achieve the effect that you want that would be narratively satisfying, without being bound by a RAW approach.
- Perhaps there's a liminal space there between this plane and the Feywild or Aborea, that's causing massive and inexplicable growth in the vegetation?
- Maybe upon fighting their way to its centre, your players will find a cursed legendary item from one of these planes, that's causing the growth (through a hugely magnified and ongoing version of the Plant Growth spell), and that must be destroyed by the players before a nearby town is subsumed?
- Could there be a monster at the centre, whose 'lair actions' are causing this growth? An Adult Green Dragon is probably the best fit - though I'd still suggest homebrewing this slightly as RAW you'd need multiple dragons to cover an area as large as you desire, and the thorns their 'lairs' grow could kill most PCs before they even find the dragon.
- Or, maybe you simply want to homebrew the spell, and rule that in your game, casting Plant Growth at higher levels increases it's area of effect (as suggested by Erik in comments)? Or, perhaps you'll allow Plant Growth to be cast as a ritual spell (as commented by Dan B)? Or that, in your game, the effects of the one action casting of Plant Growth, are also included in the wider area affected by the eight hour casting of the spell?
Any of the things that you've mentioned in your question ('spells, items, gates, otherworldly entities') could be a potential avenue for a solution to your issue, and narratively exciting for your PCs at the same time.
How something in your world has happened is up to you as a DM, but to get there you don't always need to be rigidly bound by RAW.
It's perfectly acceptable to use the Plant Growth spell as a jumping off point for your narrative inspiration, without having to worry about the players wanting to be able to replicate the exact situation themselves. NPCs may be able to do things that players can't and your PCs will almost certainly have skills that your NPCs don't.