How does the “shotspot” on televised tennis matches work?

The “shotspot” is a tool that generates an extremely accurate animation of any given shot that was close to a line to determine whether it was in or out.