As far as I know, trap is something that happens when special events occur. In case of a system call, program executes trap instruction and jumps to kernel mode. Then, trap handler jumps to desired handler (e.g. fork, exec, open).
When the execution of fork, exec, open, etc. is finished, the OS calls return-from-trap instruction and makes the program go back to user mode.
But what exactly is a trap handler? (Also, if you may, what is a trap table?)