Q:

why analogies work?

I am a philosophy noob.
I have been reading about analogies and how they form the core of cognition.
Consider this analogy:
Putting a resistor reduces the flow of electrons in a wire.
Putting a small obstacle in a narrow street reduces the flow of people.
Although people and electrons are noway similar, why this analogy is working!
Solution from one domain can be translated to other domain too.
Why rules for flow of electrons and rules for flow of people same?
Why understanding the street can also illuminate the understanding of electrons in a wire!
May be reality is one big fractal?
Consider cognitive entrepreneurs such as scientists,philosophers,business men etc., these are people whose profit currency is "valuable insights/ideas/patterns". Essentially these people are tremendous pattern recognition engines discovering valuable patterns in the idea/pattern space. These people use tools, one of which is analogical thinking. Looking at the massive accumulation of profits by these cognitive entrepreneurs (take Einstein and his ideas which were build with analogies) my mind is blown!
I have always thought analogies as crutches or a training wheel to understand complex concepts but it seems analogy is like a strong search light, when turned on in a dark room, we could see things which we were once blind to! It's not crutch but the very core!
If one of the tool i.e analogy is behind racking up massive cognitive profits, I wanted to know, what's behind this tool making it so successful!
Thanks!

A:

You are simply noticing that generalization works; not everything is a special case.
Electrons have a position (sort of).  People have a position.  Both can move.  Both can be constrained while they move.
An analogy is just a form of generalization where instead of stating the general form, you state a different specific form.  So instead of saying,

Entities X with a position may be constrainable to move along paths Y, and said path may be partially occluded by Z, observable in that the flux of X through some cross-section of Y is reduced; if X = electron, Y = wire and Z = resistor.

You say

A resistor in a wire slows electrons down, just like an obstacle slows people down in a narrow alley

The analogy invites the reader to perform the generalization step.  It's useful as people often have an easier time making a generalization themselves than they do comprehending a generalization told to them.  (The drawback is that you haven't said what to generalize or where exactly to stop.)  But this is more a matter of pedagogy than of the underlying structure of reality.
The Stanford Encyclopedia of Philosophy has much more to say on the topic, some of which I agree with.
If you are interested specifically in philosophical thought regarding the existence of regularities themselves, it's a general concern of epistemology (among other subfields).  It's most prominent, typically, when considering very clear regularities like scientific laws.

