Hi,
It's something like that.
It's a bit more complex.
First, you have the end.php
It can either display a generic thank you message or some HTML coming from the payment plugin.
In most cases, payment plugins will use that to give the HTML of a form or a URL which will redirect to the payment gateway. But if the payment plugin is offline ( like check, banktransfer, etc) it will display its HTML from its end.php file (if any), and if a "return URL" is set in that offline payment plugin, then it will direct there instead of displaying its HTML.
Second, you have the after_end.php
This one is used after a customer returns from a payment gateway (after the payment).
It can either display a generic thank you message. And if the "return URL" parameter of the payment method is set, then it will redirect to it instead of displaying after_end.