It is a judgement call by your doctor on whether to prescribe antibiotics prior to extraction. The extent of the infection is generally how the doctor will decide in addition to any possible medical problems you may have that would warrant it too. Some conditions include poorly controlled diabetes, knee/hip replacement surgery, valvular problems in the heart, etc.
If the infection is extensive and there is a risk for airway obstruction or spread to other places of the face/head, then antibiotics should be given. Usually if the infection is minor, extraction will solve the problem.
An infected area is highly acidic due to the production of acid by bacteria in an abscess. An anesthetic solution is basic. When they interact, sometimes the acid in the abscess will neutralize the anesthetic and you won't get numb. Also, when you have pain, the area is more highly sensitive to pain so it may require more anesthetic.
There are times when anesthetics don't numb the patient enough to get the tooth extracted that way, in which case pain medications and antibiotics may be prescribed to "calm" the area down prior to extraction.
Hope that helps