How does BASH handle KEY BOARD "up arrow"??

hello sir,
I am studying the BASH shell. I was wondering how the BASH is able to handle the "up arrow" key to give the commands that were previously typed by us. Can you please tell me the code to do such an operation. I want to handle more such keys and put KEY BOARD short cuts to the BASH shell.

Bash, if it can find it (using the dynamic linker), uses the "readline" library suite,