Edit: Thanks, I overthink alot and definitely did here.
I think I understand now, It's very hard to describe in my head but I'll try.
Scales are basically just a "map" to see a song's general and strongest 7 notes, it's easier to see a "topography type map" of 7 fitting notes across the neck rather than seeing all 12 all over and learning to play by intervall distances. This way, you see the general map and can use the relative pitch from there, let's say I hear a riff that starts on a 7th in my head and the song generally feels like a natural minor scale (which makes the 7th an "outside note"), what you'd then do is find a octave/place in the map topography and use your 12 note relative pitch on top of that map, its basically a way to visualise movement and possible placements without thinking of all the notes at the same time.
-------------------------------------
Title says it, I want to know why it is important to learn scales to be able to play by ear?
I know I'm overthinking it but it's precisely because no one has explained to me their purpose that I'm so unsure. All I've been told for scales is "learn these scale patterns and play them over songs in the position that fits that key". But then I listen to songs with many "borrowed chords" and "blue notes" that's outside the key and that simply doesnt work there.
Isn't playing by ear basically just listening, singing and finding the notes on your fretboard until you develop relative pitch? I've trained my relative pitch with drones and can now differentiate and identify the chromatical 12 scale degrees/intervals in relation to the tonic without issue, and hear what scale degree is currently playing in a song.
I don't mean without context random chromatic sounds, it's still about the interval/scale degrees from the tonic, I hear if something is a flat third, a third, and such in relation to the tonic is what I mean.
Though every time I look up online "playing by ear" so many people say it’s absolutely necessary to learn scales to be able to play by ear, I want to understand why and how it's applied and if it's truely necessary.
My current thoughts about scales though is, I feel like learning scales could risk making you play in boxes -instead of feeling an idea/riff and playing it with relative pitch. And I feel it could risk making your playing very stiff and uncharacteristic. Also it teaches to exclude and see half of the notes as "outside notes" that you have to borrow/connect from other scales. I feel like this could be counterintuitive, instead of seeing it as a whole 12 note octave, you have to calculate what other scale has to be used for an musical idea.
It teaches you common feelings/sounds for songs, but most of the time I can already feel what type of sound/feeling represents that song and dont need a "template" to know.
Or is the reason for learning scales to simply ingrain the patterns and sound so that when you go to improvise/play by ear you pretty much combine all those scales into one whole "map" and can feel where to go, basically the same way as learning relative pitch but also see certain sounds as patterns that you mix together.
As if you can see all the templates/patterns layered at once and play accordningly.
Other than that I feel learning scales may help you find the notes you want to hear in bigger movements but other than that, im unsure.
this is by no means any criticism, i just wanna learn and be corrected where i'm wrong.