Modifying the functions.php file allows you to add custom functions, classes, actions, and filters to your WordPress theme. However, if you switch to a different theme, any functionality added through functions.php will be lost. So, it's important to keep a backup or transfer the custom code to the new theme.