Looks like you are lazy loading the entities.
You can eager load them by using .Include
.
var allUsers = context.Users.Include(user => user.Groups).ToList();
This approach loads the first entity (Users) as well as the related entities as part of the query (Groups).