What is the basic difference between biases, such as confirmation bias, anchoring bias, etc., and fallacies such as argumentum ad antiquitatem, argumentum ad hominem, argumentum ad ignorantiam, etc.? How exactly do they differ, and how are they related?
A fallacy is flawed reasoning. For instance, if one concludes that a math proof is correct, not on the merits of the steps of the proof, but because a famous mathematician is providing it, the reasoning is clearly flawed by an appeal to authority. Famous mathematicians can and do make mistakes, and the nature of mathematical proof rests in the consistency of the logic from step to step.
A cognitive bias is systematic error-making in thinking. Let's say you are doing research, but after your PhD advisor looks at your sources, it becomes clear that you are drawing from one set of papers that supports your thesis, while there's an entire set of papers that refutes your thesis. It might be that your choice to do so is consistent with the fact that you routinely avoid any positions critical of your position. In some way, you are confirming your belief through a non-conscious selection of avoiding evidence avoiding disconfirmation.
Both bias and fallacies are types of errors, but a bias is a pattern of making a similar error, and fallacies are errors that apply to a given argument. In other words, fallacies are individual, logical errors in reason, whereas cognitive biases are consistent, psychological errors in thinking.
To address claims in the comments: Biases might cause fallacies, but the important thing about biases is that they are systematic. Everybody makes mistakes errors in reason, but one who does consistently in the same way is biased, and it's important not to conflate the two. Think about lies, and pathological liars. Some people tell lies from time to time, but those who do so with zest, zeal, and compulsion are fundamentally different. And biases aren't what we want to believe, they are what we tend to believe erroneously. I personally have biases, but in a bid to improve my reason very much work hard because I don't want to believe error-riddled reasoning. Many people are comfortable with their biases, but many people work hard to overcome them precisely because they want to be closer to being free of errors.