I've always wondered - how are unforced errors distinguished from forced errors? Does IBM put machines in the player's head and analyze their level of stress when hitting the ball?
As Pratik said, the person keeping stats decides.
The general rule is that if you have to move quickly to get to the ball, it is a forced error. If you have time to prepare the shot, then it's an unforced error. Not every stat collector has the same opinion about this, though, judging from their efforts in matches I've seen.