How to resolve the problems encountered when moving from local to server? Which things do we need to be aware of and change when moving a site (in Drupal 8) from a local environment to a server?
In Drupal 7 I would just copy the files, change the database settings in settings.php, and import database, clear all caches, and that's it.
2 problems come up with the 'move files, move database' method, which are:

All links on the server-side site use the local url. Where does it get that information?

When I navigate to /user/login I get this error on a white page:

Redirects to external URLs are not allowed by default, use \Drupal\Core\Routing\TrustedRedirectResponse for it.
I'm assuming you're moving the files and database, as you state in your question:

Moving a site from MAMP should be pretty easy.  One thing you may be missing is updating $settings['trusted_host_patterns'] in your settings.php or settings.local.php

$settings['trusted_host_patterns'] = array(
   '^mysite\.com',
   '^.+\.mysite\.com',
   '^mysite\.local',
   '^.+\.mysite\.local',
 );


Another thing you may have forgotten to do is to clear the cache once you move the files and database.

Usually I use the drush command line utility and then from the docroot of the site, or the /sites/default directly run "drush cr".