How does voice acting relate to animation?
It's simple; the voices of the characters don't just magically add themselves once the drawings are done. Those voices come from real people. Without voice acting, we'd still have silent animated films, or just flat lines read off by disinterested studio animators without the training or talent to add the right inflection and personality to the lines.
How is voice acting done?
A group of actors - some professional voice actors, some noted celebrities - gather in a recording studio and, with their scripts in hand and parts ready, act out the parts of their characters. It requires just as much skill as acting a part in a film, for the actors still have to make the emotions portrayed by the characters' voices believable. It can require multiple takes when actors flub or miss their lines, and sometimes listening to recorded outtakes can be hilarious. The audio recorded is synched with the animation and with the musical tracks to bring the entire piece together.
What about online Flash animations?
You'd be surprised how many non-studio animations still go to the trouble of using a recording studio and formal recording processes, but as home computer technology advances, it's not always necessary. Home recording equipment can let you set up a home-brewed recording studio pretty easily, but it's still a matter of recording good audio / finding good voice talent. It's not as easy as some people make it sound. However, if you need voices for your animated characters, there's nothing that says you can't hook up your own microphone and record your own audio.