The hero object came from the *ngFor="let hero of heroes".
ngFor directive: is a way of repeating a template by using each item of an iterable as that template's context.
Every loop of heroes will use a specific hero object and will create a li element that will bind an onClick event using (click)="onSelect(hero)".
As you can see, onSelect method was declared in your component as onSelect(hero: Hero): void this declaration allows you to use it in any place within the component's selector.
On the other hand, heroes object is an Array of type hero and will be loaded previously within your component.
Probably, that Array was loaded calling a specific service to load heroes and it's one of the first thing that every component must do for loading the necessary data that will be rendered.
In component HeroesComponent the data regarding heroes was declared as follow:
heroes = HEROES;
In that tutorial, the heroes data is provided by this file mock-heroes.ts and its content is the following:
import { Hero } from './hero';
export const HEROES: Hero[] = [
{ id: 11, name: 'Mr. Nice' },
{ id: 12, name: 'Narco' },
{ id: 13, name: 'Bombasto' },
{ id: 14, name: 'Celeritas' },
{ id: 15, name: 'Magneta' },
{ id: 16, name: 'RubberMan' },
{ id: 17, name: 'Dynama' },
{ id: 18, name: 'Dr IQ' },
{ id: 19, name: 'Magma' },
{ id: 20, name: 'Tornado' }
];