What is the proper etiquette for doing the wave at a baseball game is it to motivate the batter and rattle the pitcher?

It is intended to distract the opposing teams pitcher as it rounds home plate, but usually it is done because the fans are bored and looking to have some fun.