How does Arduino call setup() and loop() function?

I'm totally new to Arduino programming and I'm a bit confused with the 'Blink' example code:

void setup()
{
pinMode(13, OUTPUT);
}

void loop()
{
digitalWrite(13, true);
delay(500);
digitalWrite(13, false);
delay(500);
}

With my experience in C++ programming, all functions need to be called in main() to get executed. However, there's no main() in above code and how Arduino call them?

Moreover, why do we need a loop() function? Cannot we just write a for-loop?

There is a main(). It's added by the IDE. Try looking someplace like:
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino

gfvalvo:
There is a main(). It's added by the IDE. Try looking someplace like:
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino

Can we use for-loop to replace loop() function for the 'Blink' sample?

Sure. Just put it in setup():

for setup(){
  for (x=0; x<10; x=x+1){
  // do something
  }
}
loop(){ 
// do nothing
}

if you want to see what the main() (that gets added automatically and which calls setup() and loop()) looks like, it's right there on GitHub (if you can't find it on your own computer)

int main(void)
{
	init();

	initVariant();

#if defined(USBCON)
	USBDevice.attach();
#endif
	
	setup();
    
	for (;;) {
		loop();
		if (serialEventRun) serialEventRun();
	}
        
	return 0;
}

If you don't want an arduino, don't get an arduino.

The setup()/loop() construct is a really clever way of structuring almost 99% of embedded programming. Embrace it.

I agree that setup() and loop() is the logical way to structure most programs, but if you don't like it you can always define your own main() in the sketch, where it will override the definition in the core library. The only limitation I found in trying to reproduce the stock main() in my sketch was the call to initVariant() breaks it (multiple definition of `main'). That function is only used on certain boards (Gemma is the only one in Arduino AVR Boards) so it wasn't necessarily a deal breaker but it was unfortunate to not be able to reproduce all the functionality in the sketch. There may be a way around that, I didn't spend a lot of time on it since I didn't have any real need to do this.