New Developer Need Help

I am new to nextcloud development I am trying to understand its structure and how it is coded in the app development tutorial return new TemplateResponse('notestutorial', 'index');
the above line of code return the template that is named index inside notestutorial app how this done this line for me create new object from class TemplateResponse so I am very confused
I traced this object of type TemplateResponse and type var_dump and die in all its functions the only function that printed my dump was render function so how this function is called

You create this object and return it. There is some logic to render the template accordingly. Which part do you need explanation?

\OCP\AppFramework\Http\Response::render is the render method that is overridden by the TemplateResponse. It will be called by Nextcloud. You don’t have to worry about this as an app developer.

where this call \OCP\AppFramework\Http\Response::render happen I trace the code in theapp and this not found

In \OC\AppFramework\Http\Dispatcher::dispatch. But again, you should not have to worry about this from an application developer perspective. It will be called for you when the response object is converted into a HTTP response. This concern is being taken care of for you.