A SOQL relationship query is one SELECT statement that also reads fields from records linked to it by a lookup or master-detail field. Think of it as walking along the lookup: up from a contact to its account, or down from an account to every contact under it, without leaving the query.
If you write Apex, build an LWC data source or answer “show me each account with its contacts”, this is how you get related data in one round trip instead of a query per record. We ran every example below in our developer org on API 67.0, so you will be able to pick the right direction, find the relationship name for any object and read the results in Apex.
Two directions, two syntaxes
Every relationship has a parent side and a child side. Contact has a lookup (AccountId) to Account, so Account is the parent. Our custom pair works the same way: Invoice_Line_Item__c has a lookup to Invoice__c. The lookup or master-detail field is what makes the walk possible.