In my experience, its all over the board... some can hear a tune once or twice and play it perfectly, some can play it 1,000 times and still need to look at a something written out. And for some its a combination of the two.

Then there are situations where playing in a band or combo you have to play a specific arrangement a specific way and its a bit different from what you've done in the past. Its a new or different arrangement. In that case, having the written part in front of you might be the best; even if only to remind you... look out! remember... changes HERE, HERE and HERE. You have to do your job and play what you are supposed to play the way you are supposed to play it. Looking at a piece of paper to do it does not matter at all.

Even a pro with decades of experience will flub lyrics from time to time. There's a very famous live recording of Ella Fitzgerald flubbing "Mack the Knife" (I think that's the tune)... totally forgetting the lyrics. She recovers wonderfully and its a terrific performance.

Memorizing a tune or lyrics? There's no magic answer or nifty trick I know of.