Gimli recounts the assault of the Undead as follows (Return of the King, Chapter 9, The Last Debate, page 910):
but I know not whether their blades would still bite, for the Dead
needed no longer any weapon but fear. None would withstand them.
So the Undead use only fear as a weapon. And a bit later:
‘Ere that dark day ended none of the enemy were left to resist us; all
were drowned, or were flying south in the hope to find their own lands
upon foot. Strange and wonderful I thought it that the designs of
Mordor should be overthrown by such wraiths of fear and darkness. With
its own weapons was it worsted!’
So the Undead used fear against servants of Darkness, who are especially susceptible to it. Not quite as far fetched as the movie.
But stepping back, there are a lot of similarities. In the book, the Undead freed the hands of the Southern army of Gondor. Aragorn led that army to the Battle of the Pelennor Fields. By letting the Undead turn the tide, the movie actually retains the causality of the book's events.
A goal of the movie is to be faster-paced, and to make the characters more of a driving force. The change of the Undead from a mystical emotional danger to physical warriors fits right in. Enjoy these well-written words from wikia.com:
The overall effect of the entire movie series was that it told a story
that was recognizably that of Tolkien's, but it did so with major
thematic and other differences that tended to disappoint his fans.
These differences were not, however, of any importance to the movie's
target audience— the enormous worldwide movie going public most of
whom knew nothing of the story. Despite the differences, The Lord of
the Rings motion pictures are beautiful and stunning epic movies that
tell a great story in their own right.
Wikia's detailed list of differences is also worth reading. The book's characters shoulder their burden with resolve, even when there is little hope. The movie's characters are more free: they show fear and doubt, yet take more credit for their success. That might also be a sign of the times: between the faithful Christian Tolkien in the 1940s, and the zombie movie maker Jackson in the 2000s.