I have seen the function exists() been used in source codes, but can't find any information about how this function works. So how does this function work?
It's not a standard function, so you'll have to give a little more information.
"exists" is a common name for a function that returns a bool or an int set to true if what the parameter refers to exists in a given context.
For example, a bool exists(char *filename) would return true if the file with that name exists in the file system.