If we're going strictly by the movies?
The last time Sauron knew who had the ring was when Frodo put it on to get away from Boromir. The Fellowship had not disbanded then, so Sauron was still in the dark(heh) of the actual whereabouts of the ring.
The next time Sauron is given a hint to where the ring is(a wrong hint) is when Pippin uses the Palantir. Whether Sauron knew the fate of Orthanc/Saruman? I'm not sure, but the news surely would have spread to him quickly. So what does Sauron know at this point?
- A hobbit previously held the ring, and could still be holding it.
- A hobbit was just using the Palantir that Saruman used.
- Saruman knew a halfling had the ring.
He thought for sure that Pippin was the hobbit that had the ring, and probably assumed he was hanging out with Gandalf and Aragorn still(correct assumption this time, +1 for Sauron).
He was getting desperate for the ring, and Aragorn taking it and leading the armies of Gondor is what he feared most...and what he suspected would most likely happen. Striking fast, in his mind, was his only option.