functions.php is a file in a WordPress theme where the theme adds PHP code of its own: registering menus and image sizes, loading its stylesheets and scripts, and hooking into WordPress to change how it works. WordPress loads it on every page, both on the front end and in the admin, so it works a bit like a plugin that comes with the theme.
It’s also where many tutorials tell you to add a code snippet. That works, but a theme update replaces the file and removes your code. Unless you made the theme yourself, create a child theme and add snippets to its functions.php instead, or use a code snippets plugin. And since the code only runs while the theme is active, anything that should keep working after you switch themes belongs in a plugin.
Be careful when you edit it: a typo in functions.php can take your site down, so keep a copy of the file before you change it, and edit it with your host’s file manager or SFTP rather than in the admin. If something does break, WordPress usually catches the error and emails the site’s administrator a link to log in and fix it.