A tool-assisted speedrun (TAS) is a speedrun that uses tools such as save states/splicing, slowdown, or emulators. TASing is often used to show a theoretically perfect speedrun, test a potential strategy/skip, entertainment purposes, and sometimes even to cheat.
Types of TASes
Different methods of TASing are used and often depends on the game, platform, or the person's preference.
TASing using save states are often used together where you will use save states to get desired run of a section then you would splice the runs together into a single run.
Save states are used by creating a save state, which makes you be able to come back to a place in a run at any time, then playing and restarting from the save state until you get the desired run of a section of a game then creating another save state then repeating the process throughout the run. Save states are also often used to get a desired item from a loot table by creating a save state before item, then trying to get it until you get the item, then proceeding with the desired item.
Splicing is when you edit together separate clips of sections of the game being completed then connecting them to make a full speedrun.
Another method of TASing is to slowdown the game to allow the player to make more precise inputs then speeding the video of the run back up to look normal.
There are many emulators made with TASing capabilities where you can advance frame by frame in a game and choose exactly what frames to perform certain inputs and for exactly how long. Using emulators can make perfect TASes, however there is not TAS emulators for every platform and is usually only possible on older consoles, like the NES, with a couple exceptions, like for Flash.