Why does the following work?
List<Account> accounts = [SELECT Id, Name FROM Account LIMIT 3]; List<Contact> contacts = [SELECT Id FROM Contact WHERE AccountId = :accounts]; System.debug(contacts);
First, this is working on a "list of ids" (not really, it's a list of sObjects, more on that in a second) without using the IN operator (i.e AccountId IN [...]).
Second, the list is not a list of ids, but rather a list of sObjects. How does SOQL know to pull the Id of the sObject?
I someone can point me to where this is documented, that'd be great.