The opposite of OnCreate is OnDestroy.
The opposite of OnShow is OnClose.
If the form is a mainform, closing the form will automatically call OnDestroy event.
But if it is not a mainform:
After a form is closed, it is not destroyed. It is still exist in the system memory.
When the program is running, a form (not the mainform) can be shown and closed multiple times. So if you want to set and reset default values for variables or objects, put them in OnShow and OnClose events.
But if you want to set default values for variables or objects and free them
only once, put them in OnCreate and OnDestroy events.
If you want to learn more about form's events:
https://wiki.freepascal.org/Event_order#Forms