When you perform the 'Open database' action in the GUI, or the DbOpen() call in the command line, the application connects to your database and reads information about database objects: definitions of tables, views, and so on.
After completing the reading process, if the application has the other-side database loaded, it re-compares the lists of database objects.
The original compare approach is based on generic data types, like Number or String, that are common for all supported DBMS. It allows a basic schema diff and a limited data diff and merge: columns of the Other generic type, like GUID or JSON, are not compared. Later the concept of Target schema was added: one of the databases is marked as the target in the Open databases dialog, and the objects and data of the other database are converted into the target DBMS. It allows a more detailed schema diff, schema merge of new tables, and a more capable data diff and merge. See the "With Target Schema" sections in the Schema and Data pages below.