The global temporary table is simply the logical definition of a table structure (Name, column names, column data types etc). When a session references it by inserting data, a data segment is created in a temporary tablespace to hold only that session's data. Different sessions can therefore reference the same logical table definition because they each have their own dedicated data segment which can be purged easily on commit or when the session disconnects without affecting other sessions.
The purging of the data in the GTT can either be on commit or when the session ends, depending on the option with which it was created. In either case you do not have to attend to the purging yourself before disconnecting.
A useful alternative to the GTT is the subquery factoring clause ("WITH"), in which you can create multiple relations that can reference those previously declared in that SQL statement. These can be materialised as a data segment in a temporary tablespace either automatically by Oracle when they exceed a certain memory usage, or manually by using the MATERIALIZE optimizer hint.