You must have seen the checkbox Receipt on Invoice on Purchase & Payable setup and Shipment on Invoice checkbox on Sales & Receivable setup.
Why does keeping these checkboxes checked will do? You may say that the name of the field itself explains its use.
Meaning, if the Receipt on Invoice is checked (in Purchase & Payable Setup), then creating the Purchase Invoice alone (from Purchase Invoice list page) will also create the Purchase Receipt.
Similarly, if the Shipment on Invoice is checked (in Sales & Receivable setup), then creating the Sales Invoice alone (from Sales Invoice list page) will also create Sales Shipment.
You are right in saying this.
But, now the real question is why do we need to create Purchase Receipt/Sales Shipment at all on creation of respective invoices?
The misconception
Before answering this let me clear our one common misconception on this topic.
Many people asked me (answered me through this rhetorical question) that if Receipts and Shipments are not generated, then how will inventory impact (inflow/outflow of inventory) occur?
Let me clarify this, generation of Purchase Receipt and Sales Shipment is not mandatory for inventory impact. For Inventory impact, the creation of an Item Ledger Entry is required.
Here, even if you create a Purchase Invoice directly (keeping Receipt on Invoice unchecked in Purchase & Payable Setup), then also the Item Ledger Entry would be created. The only difference you can notice is that the Item Ledger Entry would be created with the document type as Purchase Invoice, instead of Purchase Receipt.
The Actual Reason
We need Purchase Receipt and Sales Shipments lines for Item Charge Assignment. You can observe in the below video that whenever we try to assign an Item Charge assignment, we need to select the Purchase receipt/Sales Receipt lines. Hence, if Purchase Receipt and Sales Shipment are not created, we would not be able to load any Item Charge (through Invoice later on).
Please make note that here we are considering a very common and usual situation where some charges may arrive later on i.e.after the Receipt and Invoice for the items are posted completely and later on we need to assign some additional charges (like Shipment Charges as the invoice may separately come later by the logistic company).
Hope it helps! Cheers!