Q:

How do CiviCRM profiles hook up with Drupal?

We have been using Drupal and CiviCRM for 5 years or so to edit profiles. Setup via the Administration -> Customise Data and Screens -> Profiles.
It is now saying 'The changes have been saved' and reloads the form with the old data rather than updating the CRM database. 
I have been searching the drupal folder in civicrm for a submit hook and anything to test the connection. How does it work?
Drupal 7.41 and Civicrm 4.5.8.

A:

The question was 'how do I debug this from first principles' so that I don't have to work from my sometimes flawed knowledge of the application. 
The solution was to turn off a panel that was overriding the CiviCRM forms. This is readily discovered by looking at HTML source code as panels prints out the panels classes and they didn't look right. 
Trying to debug the source code was no use in this case and cost a couple of days effort. If you want to check that civicrm is running or follow the form creation process start at civicrm_form_alter() in a drupal system.

