It is difficult to obtain satisfactory anesthesia in the presence of infection near the injection site because

acidity of the infected tissue inhibits action of the anesthetic agent.

the swelling causes increased pressure on the nerves.

increased blood supply carries the anesthetic solution away too fast.

alkalinity of the infected tissue inhibits action of the anesthetic agent.