Custom doctypes are loaded directly in the Database compared to standard doctypes where the schema is controlled via JSON, and the custom fields go to the db.
Is there a way to distinguish system doctypes(doctypes that are created by erpnext) from user created doctypes(after erpnext installation, users can create their own doctypes)?
Each doctype must belong to a module, and each module must belong to an app. For non-custom doctypes, you can identify which app a doctype belongs to by fetching module details.