When you start playing in a band, it's six months to a year of playing through the songs in your setlist 3-4x a night 2-3x a week before that first gig. Y'all play shit that much you're gonna remember it. It's about muscle memory and repetition.
There are some songs I picked up after not playing them for 10 years and I remembered the main parts easily and most of the minor parts. By the second or third playthrough, I remembered almost all of it. (not necessarily applicable to fast solos). Newer songs I learn, I don't play as much and therefore forget much quicker.
There are probably still maybe 150-200 songs I know the bulk of and can polish up for audition within a couple days if I needed to (did that once pre-pandemic and wound up thinking the rest of the band were losers, but oh well).