A function is a block of code that executes when called, promotes code reusability, and allows parameter passing. The syntax includes specifying a return type, function name, and parameters. Functions enhance code readability and efficiency in execution.