In Drupal 7, routing was handled by the hook_menu() function, which had many responsibilities beyond routing like access control and file uploading. This led to routing being tightly coupled with other tasks. In Drupal 8, routing was decoupled from hook_menu() and is now defined in module routing files using the Symfony HTTP kernel, with routes specified in YAML format. This separates routing from other responsibilities and makes the system more modular and in line with other frameworks.