What's the difference between an infected tooth and a cavity?

Infected tooth. A cavity is a hole in the tooth caused by decay. This is usually repairable by removing the decay and restoring the tooth with a filling or a crown. An infected tooth is an infection of the nerve of the tooth. This is usually caused by deep, untreated decay, but can also be caused by trauma, like a blow to the tooth. An infected tooth is treated by a root canal procedure.
Possibly none. A cavity is a hole in a tooth - caused by bacteria on the tooth. This can also be called an infected tooth. Sometimes when the decay gets deep enough - it gets to the nerve/blood vessels inside the tooth - and they die - also can be called an infected tooth, and finally sometimes it is the gum around the tooth that is swollen/infected from different bacteria - also an infected tooth.