Let's say we do this
`$users = User::with('comments')->get();` 
it will execute

```
select * from `users`
select * from `comments` where `comments`.`user_id` in (1, 2, 3, 4, 5)

```

I don't understand how Laravel knows which comments are linked to which user? Does Laravel do some extra code after it executes queries to link each user to his comments so when we do:

```
foreach ($users as $user) {
    $user->comments //Laravel knows that which comments to load for this user
}

```