The term reward function originates from the fields of artificial intelligence, automation and robots. A reward function is a central component in many modern technologies. It helps to control machines or programs by showing them which behaviour is "good" or "bad".
You can think of the reward function as a points system. Whenever an artificial intelligence or robot performs a task, the reward function checks the result and awards points - the better the result, the more points are awarded. The machine therefore constantly tries to collect as many points as possible in its decisions.
A simple example: A robot vacuum cleaner is supposed to clean a flat. The reward function gives it one point for every crumb it vacuums up. However, if it blocks itself on a chair leg, no points or even minus points are awarded. In this way, the robot gradually learns how to clean optimally without getting tangled up.
To summarise: The reward function is the reward system with which smart technologies learn to become better and better and complete tasks more efficiently.