In The Amazing Spider-Man 2, there's this one scene in particular where Max Dillon leaves the hospital and goes into a crowded area in search of electricity, at the same time Peter Parker is with Gwen Stacy talking to her who is at least couple of miles away from Max Dillion (Electro) and all of a sudden Peter leaves Gwen and his ordinary clothes and goes to the place where Electro is, as if Peter sensed the danger.

My question is, how did Peter know that something bad is going to happen even though Electro has not caused any damage or done any harm to the civilians?

2 Answers
2

AnkitSharma already gave some general explanations about the "spider-sense", which is indeed an aspect present in the movie. But as to the particular scene you are mentioning, I'm not so sure that he really needed the "spider-sense" there. Though it may also be that I just don't remember it well enough.

First of all, while I might not have too much information about the comics, it would seem a bit strange to me for the spider-sense to work over that far a distance, especially seeing that it wasn't an immediate danger, but only a rather suspicious event miles away.

But even more than that, I think PeterandGwen (who doesn't have a spider-sense) looked into the direction of Times Square when there was already something visibly and audibly unnormal happening. Max (or Electro for that matter) had already caused some havok on Times Square's huge screens and some strange electric effects when Peter and Gwen looked there. So they (and the audience, I think) already saw and heard that there was something strange going on.

Spider-Man's "spider-sense" manifests in a tingling feeling at the
base of his skull, alerting him to personal danger in proportion to
the severity of that danger. For instance, a little tingling such as a
happenstance passing by of an enemy would prompt Peter to be alert,
while a strong tingling, sometimes to the point of being painful, is
interpreted as a need to take immediate evasive action on a deadly
threat. It appears to be a simultaneous, seemingly clairvoyant
response to a wide variety of phenomena. Though the exact mechanism of
this ability is unknown.

So in all incarnation whether its animation or film or comics his Spider sense doesn't indicate only big danger but also useful in detecting nearby villains too.

Even in one animated series he also alerted by spider sense when he hand shakes with a person (who is villain but he is not aware of it). In Sam Raimi's film, this spider sense is not that great but looks like the new film making it back to the original.