If you are still looking for clarification regarding IDocs, I recommend the SAP Learning Hub ebook on ALE (application link enabling). It offers a technical and conceptual summary of IDoc technology and its use in SAP.
To answer a few of your questions, yes, there are predefined IDoc types. Together, the basic type and message type characterise the structure and data to be sent in the IDoc.
The IDoc itself consists of:
- Control Record: this is the metadata, where information concerning
the IDoc type and details of sending and receiving systems are
stored.
- Data Records: this is where the information (stored in segments)
that you are sending can be found.
- Status Records: contains information concerning whether the IDoc
transfer was successful. If the IDoc fails, you can investigate the
potential reason by looking at the status codes here.
The segments that you use will be defined by the configuration and business requirements of the SAP system you are working in. You can append the segments and create customer defined types, but, as there are so many predefined IDocs, there will likely already exist something you can use.
IDocs are intended to be used in integration scenarios. They can be used to send data out of an SAP system or to receive data into an SAP system. IDocs are designed for data exchange between, rather than within, a system. They can be sent to other SAP systems or to non SAP systems, depending on business requirements. This is their main purpose in SAP.
If you are interested in the process of configuring an ALE scenario for a specific business process, this blog post provides a thorough example:
https://blogs.sap.com/2012/10/08/ale-distribution-of-cost-center-and-gl-account-master-data-across-sap-systems-through-idocs/