A workflow instance consists of a process, a set of tasks and a set of transitions. Process variables apply to the entire process. Task variables apply to each task. In a workflow engine like JBPM or Activiti you can configure whether task variables are mapped to process variables at the start and end of a task.
While it may not seem useful for a simple sequential workflow, imagine the situation where we have a workflow requiring three approvals in parallel. Each approval task will have its own set of task variables but how that relates to the overall process variables is not 1 to 1. Perhaps a business rule may require all 3 approvers to say "yes" and if they do then the entire process moves onto the next stage with an overall status of "approved". But if one or more say no then a list of comments is sent back to the initiator.