Expert witnesses – witnesses who testify as to their “professional” opinions – may be paid for their testimony (actually, they won’t testify unless they are paid). Supposedly, they are paid for their time, the content of their testimony being (again, supposedly) unbiased (apparently because they are “professionals”).
Fact witnesses – witnesses who testify as to facts, i.e. what occurred, may not be paid for their testimony, as it is believed that this could prejudice their testimony (fact witnesses are generally not “professionals”).